System upgrade method and device, computer readable storage medium, and electronic device
By creating the upgrade service version in an independent process and using the target version selector to dynamically determine the service version, the technical selection restrictions and security issues of code logic during system upgrades in the existing technology are solved, and the flexibility and security of system upgrades are achieved. sexual enhancement.
Patent Information
- Application Number
- CN202110012699.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-06
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-01-06
AI Technical Summary
In the existing technology, due to the poor openness of technology selection of code logic during system upgrade, different coding technologies cannot be mixed in the same process, which limits the flexibility and security of system upgrade, and the decision-making factors and implantation points are hard-coded. This makes it difficult to do unit testing and application layer rollback.
By creating upgraded service version information in an independent process, registering it with historical service version information in the service registration center, and using the target version selector to dynamically determine the service version, we can achieve the separation of code logic and dynamically distribute service requests, avoiding the need for historical versions. changes.
It realizes system upgrade without changing the historical service version, improves system update efficiency and security, separates the decision-making factors of the splitter, and simplifies the unit testing and application layer rollback process.
Smart Images

Figure CN113791799B_ABST
Abstract
Description
Background Art
[0002] With the development of Internet technology, large Internet companies' service systems often need to be updated and upgraded after running for a period of time as their business operates and develops.
[0003] In the prior art, the service system is upgraded by directly modifying the historical business logic code or by inserting the change code based on the interceptor. However, the change business logic code and the historical business logic code in the prior art can only use the same coding technology and run in the same process, resulting in poor openness of technology selection.
[0004] In view of this, there is an urgent need in the art to develop a new system upgrading method and device.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the present disclosure is to provide a system upgrade method, a system upgrade device, a computer-readable storage medium and an electronic device, thereby improving the system update efficiency at least to a certain extent.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0008] According to one aspect of the present disclosure, a system upgrade method is provided, the method comprising: using an independent process to create an upgrade service version corresponding to upgrade service version information, and registering the upgrade service version information and historical service version information into a service version information list in a service registration center, wherein the upgrade service version information and the historical service version information both include a service identifier, a service version identifier, and a service instance identifier; responding to a service request, the service request including a target service identifier and user information, querying the service registration center for target service version information corresponding to the target service identifier, and target version selector information; running a target version selector corresponding to the target version selector information, determining the target service version identifier corresponding to the user information through the target version selector, and sending the service request to the target service instance corresponding to the target service version identifier.
[0009] In some exemplary embodiments of the present disclosure, the method further includes: respectively configuring a first version selector corresponding to each of the service identifiers, and registering the first version selector information corresponding to the first version selector into a version selector list in the service registration center, wherein the version selector list includes the service identifier and the first version selector information.
[0010] In some exemplary embodiments of the present disclosure, the method further includes: configuring a version selector corresponding to each of the service instance identifiers in the upgraded service version, and determining a second version selector in the version selector corresponding to each of the service instance identifiers; and registering the second version selector information corresponding to the second version selector in the service version information list while registering the upgraded service version information and the historical service version information in the service version information list.
[0011] In some exemplary embodiments of the present disclosure, querying the target service version information corresponding to the target service identifier and the target version selector information at the service registration center includes: sending a service query instruction to the service registration center through a service access terminal, wherein the service query instruction includes the target service identifier, so that the service registration center outputs the target service version information corresponding to the target service identifier and the target version selector information according to the service query instruction.
[0012] In some exemplary embodiments of the present disclosure, the target service version information corresponding to the target service identifier and the target version selector information are queried in the service registration center, including: querying the target service version information corresponding to the target service identifier in the service version information list, and querying the first version selector information corresponding to the target service identifier in the version selector list, and configuring the first version selector information as the target version selector information.
[0013] In some exemplary embodiments of the present disclosure, the method further includes: if the first version selector information corresponding to the target service identifier does not exist in the version selector list, querying the second version selector information corresponding to the target service identifier in the service version information list, and configuring the second version selector information as the target version selector information.
[0014] In some exemplary embodiments of the present disclosure, a target version selector corresponding to the target version selector information is run, and a target service version identifier corresponding to the user information is determined through the target version selector, including: judging through the target version selector whether the user information meets a preset condition; if so, determining that the target service version identifier is the service version identifier corresponding to the upgraded service version; if not, determining that the target service version identifier is the service version identifier corresponding to the historical service version.
[0015] In some exemplary embodiments of the present disclosure, the upgraded service version information and the historical service version information also include a service instance address corresponding to the service instance identifier; sending the service request to the target service instance corresponding to the target service version identifier includes: obtaining multiple service instance identifiers corresponding to the target service version identifier, determining the target service instance identifier from the multiple service instance identifiers according to a load balancing strategy, and using the service instance address corresponding to the target service instance identifier, and sending the service request to the target service instance.
[0016] According to one aspect of the present disclosure, a system upgrade device is provided, which includes: a registration module, which is used to create an upgrade service version corresponding to upgrade service version information using an independent process, and register the upgrade service version information and historical service version information to a service version information list in a service registration center, wherein the upgrade service version information and the historical service version information both include a service identifier, a service version identifier, and a service instance identifier; a query module, which is used to respond to a service request, wherein the service request includes a target service identifier and user information, and query the service registration center for a target service version information list corresponding to the target service identifier, as well as target version selector information; and an operation module, which is used to operate a target version selector corresponding to the target version selector information, determine the target service version identifier corresponding to the user information through the target version selector, and send the service request to the target service instance corresponding to the target service version identifier.
[0017] According to one aspect of the present disclosure, a service system is provided, the service system comprising an upgrade service provider, a history service provider, a service registration center and a service access terminal, wherein: the upgrade service provider is used to create an upgrade service version according to upgrade service version information, and register the upgrade service version information with the service registration center, the upgrade service version information comprising an upgrade service identifier, an upgrade service version identifier, and an upgrade service instance identifier; the history service provider is used to create a history service version according to the history service version information, and register the history service version information with the service registration center, the history service version information comprising a history service identifier, a history service version identifier, and a history service instance identifier; the service registration center is used to store the upgrade service version information and the history service version information in a service version information list; the service access terminal is used to respond to a service request, determine the target service version information and the target version selector information according to the service request, and run the target version selector corresponding to the target version selector information, and determine the target service version identifier corresponding to the user information through the target version selector.
[0018] In some exemplary embodiments of the present disclosure, the service access end includes an information query unit and a script running unit, wherein: the information query unit is used to respond to a service request, the service request includes user information and a target service identifier, and query the target service version information corresponding to the target service identifier and the target version selector information in the service registration center according to the target service identifier; the script running unit is used to run the target version selector, determine whether the user information meets a preset condition through the target version selector, and determine the target service version identifier according to the judgment result.
[0019] According to one aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the system upgrade method as described in the above embodiments is implemented.
[0020] According to one aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the system upgrade method as described in the above embodiments.
[0021] It can be seen from the above technical solutions that the system upgrade method and device, computer-readable storage medium, and electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
[0022] The system upgrade method disclosed in the present invention first uses an independent process to create an upgrade service version corresponding to the upgrade service version information, and registers the upgrade service version information and the historical service version information to the service version information list in the service registration center, wherein the upgrade service version information and the historical service version information both include a service identifier, a service version identifier, and a service instance identifier; secondly, in response to a service request, the service request includes a target service identifier and user information, and the service registration center is queried for the target service version information corresponding to the target service identifier, as well as the target version selector information; finally, the target version selector corresponding to the target version selector information is run, the target service version identifier corresponding to the user information is determined through the target version selector, and the service request is sent to the target service instance corresponding to the target service version identifier. On the one hand, the system upgrade method disclosed in the present invention creates an upgraded service version through an independent process, and separates the code logic of the upgraded service version from the code logic in the historical service version, so that the code logic of the upgraded service version can be implemented independently, and avoids changes to the historical service version. That is, the service system is upgraded without changing the historical service version. On the other hand, the service request, the upgraded service version and the historical service version are taken as input, and the final target service version is obtained through the target version selector, which separates the decision factors of the existing diverter and realizes dynamic distribution of service requests.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0025] Figure 1 The flowchart of the system upgrade method based on the diverter model according to an embodiment of the present disclosure is schematically shown;
[0026] Figure 2 A schematic diagram of a process flow of a system upgrade method according to an embodiment of the present disclosure is shown;
[0027] Figure 3 A schematic diagram schematically shows the structure of a query result according to an embodiment of the present disclosure;
[0028] Figure 4 A schematic diagram schematically shows a flow chart of a system upgrade method according to a specific embodiment of an embodiment of the present disclosure;
[0029] Figure 5 The structure block diagram of a system upgrade device according to an embodiment of the present disclosure is schematically shown;
[0030] Figure 6 The structure block diagram of the service system according to an embodiment of the present disclosure is schematically shown;
[0031] Figure 7 A Unified Modeling Language (UML) diagram for upgrading a service system according to an embodiment of the present disclosure is schematically shown;
[0032] Figure 8 The module diagram of the electronic device according to an embodiment of the present disclosure is schematically shown;
[0033] Fig. 9 A schematic diagram of a program product according to an embodiment of the present disclosure is shown schematically. DETAILED DESCRIPTION
[0034] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.
[0035] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0036] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0037] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0038] In the relevant embodiments of the present disclosure, the upgrade of the service system is abstracted into a splitter model. Figure 1 A schematic diagram of a system upgrade method based on a diverter model is shown, Figure 1 As shown, in step S110, the service system receives a service request; in step S120, it is determined whether to use the business logic code before or after the upgrade, wherein the determination is made by a diverter; in step S130, if the determination result is to use the business logic code before the upgrade, the service request is sent to a server corresponding to the business logic code before the upgrade so that the server responds to the service request; in step S140, if the determination result is to use the business logic code after the upgrade, the service request is sent to a server corresponding to the business logic code after the upgrade so that the server responds to the service request.
[0039] However, the above-mentioned system upgrade method based on the diverter model requires two key elements. One is to write the upgraded business logic code to realize the upgraded business logic or system performance improvement; the other is to write the diverter model code to realize the switching between the upgraded business logic code and the business logic code before the upgrade. There are two key elements for writing the diverter model code. One is the decision factor, that is, under what conditions, the upgraded business logic code is executed. The decision factor is a decision function relationship that can use all attributes in the service request as the domain and the value range as yes or no; the other is the implantation point, that is, the context environment in which the above-mentioned decision function runs, such as a hard-coded branch and interceptor.
[0040] Among them, the change code implantation of directly modifying the relevant business logic code or interceptor is usually adopted, for example, the Filter mechanism of Servlet, the Interceptor mechanism of Struts2 and various AOP mechanisms of Spring are adopted. However, first of all, the technical selection openness of this embodiment is poor. When a new coding technology appears, it is impossible to reconstruct the old business logic code with the new coding technology. For example, in a service system, some modules may be more suitable for writing in Java11 or Go language, but other modules are suitable for the existing Java6. This embodiment cannot mix two different coding technologies in the system upgrade, which limits the selection and application of the new coding technology; secondly, the business invasiveness of this embodiment is strong and the isolation is poor. In this embodiment, the upgraded business logic code that has not been verified by production is directly released to the same process of the production environment, and only If / Else or interceptors are used for light isolation. If there are problems such as long-term occupation of lock resources, memory leaks, network connection leaks, etc. in the upgraded business logic code that will not be detected, it will affect the production process and may cause online accidents. In addition, this embodiment has hard coding in the decision factors and implantation points, coupling the branch decision code with the business processing code, and not making good isolation, which makes it difficult to do unit testing, reduces the correctness of the code and the cost of later maintenance. Finally, the application layer rollback of this embodiment is poor, because the decision factors do not determine the decision function. If there is a problem during the upgrade and launch process, the application layer rollback needs to cancel or comment some codes, which adds uncertainty to the rollback.
[0041] Based on the problems existing in the above embodiments, a system upgrade method is proposed in one embodiment of the present disclosure. Figure 2 A schematic diagram of the system upgrade method is shown in FIG. Figure 2 As shown, the system upgrade method at least includes the following steps:
[0042] Step S210: using an independent process to create an upgrade service version corresponding to the upgrade service version information, and registering the upgrade service version information and the historical service version information into a service version information list in a service registration center, wherein the upgrade service version information and the historical service version information both include a service identifier, a service version identifier, and a service instance identifier;
[0043] Step S220: responding to the service request, the service request including the target service identifier and user information, querying the service registration center for the target service version information corresponding to the target service identifier and the target version selector information;
[0044] Step S230: run the target version selector corresponding to the target version selector information, determine the target service version identifier corresponding to the user information through the target version selector, and send the service request to the target service instance corresponding to the target service version identifier.
[0045] The system upgrade method in the disclosed embodiment, on the one hand, creates an upgraded service version through an independent process, separates the code logic of the upgraded service version from the code logic in the historical service version, so that the code logic of the upgraded service version can be implemented independently, and avoids changes to the historical service version, that is, the service system is upgraded without changing the historical service version; on the other hand, the service request, the upgraded service version and the historical service version are taken as input, and the final target service version is obtained through a target version selector, which separates the decision factors of the existing diverter and realizes dynamic distribution of service requests.
[0046] It should be noted that the system upgrade method of the exemplary embodiment of the present disclosure can be executed by a server, and the system upgrade device corresponding to the system upgrade method can also be configured in the server. In addition, it should be understood that a terminal device (e.g., a mobile phone, a tablet, etc.) can also implement each step of the system upgrade method, and the corresponding system upgrade device can also be configured in the terminal device.
[0047] In order to make the technical solution of the present disclosure clearer, each step of the system upgrade method is described below.
[0048] In step S210, an independent process is used to create an upgraded service version corresponding to the upgraded service version information, and the upgraded service version information and the historical service version information are registered in the service version information list in the service registration center. The upgraded service version information and the historical service version information both include the service identifier, service version identifier, and service instance identifier.
[0049] In an exemplary embodiment of the present disclosure, the upgraded service version created according to the upgraded service version information represents the upgraded service version, and the historical service version created according to the historical service version information represents the service version before the upgrade. The upgraded service version information and the historical service version information can be represented by a triple (S, V, I), wherein the triple (S, V, I) specifically includes: S (ServiceName) represents a service identifier, each service identifier uniquely addresses a business service, the same business service has the same service identifier, and different business services have different service identifiers. For example, in an e-commerce platform, an order transaction is a business service corresponding to a service identifier, while after-sales service is another business service corresponding to another service identifier; V (VersionNum) represents the service version identifier of a business service. Under the same business service, one or more service versions may be included, each service version corresponds to a service version identifier, and different service versions have different service processing logics.
[0050] For example, in the order transaction business service, there is one service version for the first scenario and another service version for the second scenario. The first scenario and the second scenario do not belong to the same scenario; I (InstanceName) represents the service instance identifier corresponding to the service version, and each service instance identifier corresponds to a service instance. The upgraded service version information and the historical service version information also include the service instance address, which can be composed of a host address and a port number. Among them, a service identifier can include one or more service version identifiers, a service version identifier can include one or more service instance identifiers, and a service instance identifier corresponds to a service instance address.
[0051] Specifically, the upgrade service version information includes the upgrade service identifier, the upgrade service version identifier, the upgrade service instance identifier, and the upgrade service instance address, and the historical service version information includes the historical service identifier, the historical service version identifier, the historical service instance identifier, and the historical service address. The upgrade service identifier and the historical service identifier may be the same or different. If the upgrade service identifier and the historical service identifier are the same, it indicates that the service version is upgraded for the same business service. If the upgrade service identifier and the historical service identifier are different, it indicates that a new business service is created.
[0052] In an exemplary embodiment of the present disclosure, an independent process is created, and an upgrade service version is independently written using a separate program and process. The upgrade service version information corresponding to the upgrade service version includes an upgrade service identifier, an upgrade service version identifier, an upgrade service instance identifier, and an upgrade service address. The historical service version information corresponds to the historical service version, and the historical service version and the upgrade service version correspond to the same business service.
[0053] In an exemplary embodiment of the present disclosure, the upgraded service version can be written in any technology, for example, Java, C, Go, etc., and the present disclosure does not specifically limit this. When the upgraded service version is released with the help of the RPC framework, the upgraded service version releases a language client that is compatible with the historical service version with the same service identifier. The upgraded service version is open to new technologies and can be connected to the system of historical service versions.
[0054] In an exemplary embodiment of the present disclosure, the upgraded service version information and the historical service version information are registered in the service version information list in the service registration center, and the service registration center can save the upgraded service version information and the historical service version information in the service version information list. Since the historical service version has been registered once in the service registration center before the current moment, the service version information list of the service registration center has already saved the historical version information corresponding to the historical service version. Therefore, when the upgraded service version information and the historical service version information are registered in the service registration center, the service registration center queries the service version information list corresponding to the historical service version information, and saves the upgraded service version information in the service version information list corresponding to the historical service version information.
[0055] For example, the service version information list of the business service with a service identifier of "Service S#A" is shown in Table 1. In Table 1, the historical service identifier in the historical service version information includes "Service S#A", the historical service version identifier includes "Version V#A", and the historical service instance identifier includes "Instance I#1", "Instance I#2", and "Instance I#3". The service instance address corresponding to "Instance I#1" includes "10.10.1.1:3030", the service instance address corresponding to "Instance I#2" includes "10.10.1.2:3030", and the service instance address corresponding to "Instance I#3" includes "10.10.1.3:3030".
[0056] The service identifier in the upgrade service version information includes "Service S#A", the upgrade service version identifier includes "Version V#B", the upgrade service instance identifier includes "Instance I#4" and "Instance I#5", the service instance address corresponding to "Instance I#4" includes "10.10.1.4:3030", and the service instance address corresponding to "Instance I#5" includes "10.10.1.5:3030".
[0057] Table 1 Service version information list with service identifier "Service S#A"
[0058] 1 Service Logo Service version identifier Service instance ID Service instance address 2 Service S#A Version V#A Example I#1 10.10.1.1:3030 3 Service S#A Version V#A Example I#2 10.10.1.2:3030 4 Service S#A Version V#A Example I#3 10.10.1.3:3030 5 Service S#A Version V#B Example I#4 10.10.1.4:3030 6 Service S#A Version V#B Example I#5 10.10.1.5:3030
[0059] In an exemplary embodiment of the present disclosure, registration of version selector information includes two methods. One is a method of independent registration through a version selector list, which is useful for directly modifying the version selector and facilitating the subsequent use of the version selector; the other is a method of registration along with a service instance, which can create an upgraded service version together with the version selector, saving service version upgrade time.
[0060] Specifically, the independent registration method is as follows:
[0061] In an exemplary embodiment of the present disclosure, a first version selector corresponding to each service identifier is configured respectively, and the first version selector information corresponding to the first version selector is registered in the version selector list in the service registry. The version selector list includes one or more service identifiers and the first version selector information corresponding to each service identifier. Among them, the first version selector may be a shunt selector, which may include shunt logic code and preset conditions, and the first version selector information may be the first version selector script address. For example, the version selector list of the service registry is shown in Table 2. The first version selector information for the service identifier "Service S#A" may be "http: / / jarstore / sjia-selector.jar", and the first version selector information for the service identifier "Service S#B" may be "http: / / jarstore / syi-selector.jar". The first version selector can be pre-configured by engineers and the configured first version selector is stored at the first version selector script address.
[0062] Table 2 Version Selector List
[0063] 1 Service Logo First version selector information 2 Service S#A http: / / jarstore / sjia-selector.jar 3 Service S#B http: / / jarstore / syi-selector.jar
[0064] In addition, the accompanying registration method is as follows:
[0065] In an exemplary embodiment of the present disclosure, a version selector corresponding to each service instance identifier is configured during the upgrade of the service version, and a second version selector is determined in the version selector corresponding to each service instance identifier; while registering the upgrade service version information and the historical service version information in the service version information list, the second version selector information corresponding to the second version selector is registered in the service version information list.
[0066] Among them, when creating the upgrade service version, a version selector corresponding to each service instance in the upgrade service version is configured, that is, each service instance corresponds to an optional version selector. Of course, when creating the historical service version, a version selector corresponding to each service instance in the historical service version will also be configured.
[0067] In order to avoid inconsistency of the version selector script among multiple service instances, a second version selector is determined in the version selector corresponding to each service instance identifier. Specifically, the maximum service instance identifier among each service instance identifier is determined, and the version selector corresponding to the maximum service instance identifier is used as the second version selector. The maximum service instance identifier includes the service instance identifier whose registration time of the service instance is closest to the current time. For example, a service version information list registered with a second version selector is shown in Table 3. In Table 3, in the service version information list with a service identifier of "Service S#A", five service instances, namely "Instance I#1", "Instance I#2", "Instance I#3", "Instance I#4" and "Instance I#5" are included respectively, and the five service instances are registered with the same second version selector information "http: / / jarstore / version-selector.jar".
[0068] Table 3 Service version information list with the second version selector registered
[0069]
[0070] In an exemplary embodiment of the present disclosure, only the first version selector may be configured, only the second version selector may be configured, or both the first version selector and the second version selector may be configured, and the configured first version selector and the second version selector may be stored in the first version selector script address and the second version selector script address, respectively. Furthermore, the configuration of the first version selector and the second version selector may be before or after the creation of the upgrade service version, which is not specifically limited in the present disclosure.
[0071] In step S220, in response to the service request, the service request includes the target service identifier and user information, and the target service version information corresponding to the target service identifier and the target version selector information are queried in the service registration center.
[0072] In an exemplary embodiment of the present disclosure, a service request may be formed based on a trigger operation of a user on a service access terminal. The service request includes a target service identifier and user information. The user information may include account number, nickname, age, gender, contact information, address and other information. The present disclosure does not make any specific limitations on this.
[0073] In an exemplary embodiment of the present disclosure, in response to a service request, a service query instruction is sent to a service registration center through a service access terminal, and the service query instruction includes a target service identifier, so that the service registration center outputs the target service version information corresponding to the target service identifier and the target version selector information according to the service query instruction. Among them, the target service version information includes the upgrade service version information and the historical service version information corresponding to the target service identifier, and the target version selector information includes the first version selector information or the second version selector information. For example, Figure 3 A schematic diagram showing the structure of the query result is shown in FIG. Figure 3 As shown, the target service identifier in the service query instruction is "Service S#A", and the query result includes the target service version information (VersionListing) and the target version selector information (VersionSelector).
[0074] In an exemplary embodiment of the present disclosure, the target service version information corresponding to the target service identifier is queried in the service version information list, and the first version selector information corresponding to the target service identifier is queried in the version selector list, and the first version selector information is configured as the target version selector information.
[0075] Specifically, the target service identifier is matched with the service identifier in the version selector list. If there is a service identifier matching the target service identifier in the version selector list, the corresponding first version selector information is obtained according to the target service identifier, and the first version selector information is configured as the target version selector information; if there is no service identifier matching the target service identifier in the version selector list, that is, the first version selector information corresponding to the target service identifier does not exist in the version selector list, then the second version selector information corresponding to the target service identifier is queried in the service version information list, and the second version selector information is configured as the target version selector information.
[0076] In an exemplary embodiment of the present disclosure, the target service version information corresponding to the target service identifier and the second version selector information may also be queried in the service version information list, and the second version selector information may be used as the target version selector information.
[0077] In step S230, the target version selector corresponding to the target version selector information is run, the target service version identifier corresponding to the user information is determined through the target version selector, and the service request is sent to the target service instance corresponding to the target service version identifier.
[0078] In an exemplary embodiment of the present disclosure, the service access end dynamically loads the target version selector according to the target version selector information, runs the target version selector corresponding to the target version selector information, and executes the target version selector logic.
[0079] In an exemplary embodiment of the present disclosure, a target service version identifier corresponding to user information is determined through a target version selector, including: judging through the target version selector whether the user information meets a preset condition; if the user information meets the preset condition, determining the target service version identifier to be a service version identifier corresponding to an upgraded service version; if the user information does not meet the preset condition, determining the target service version identifier to be a service version identifier corresponding to a historical service version.
[0080] Among them, the preset condition can be set according to actual conditions. For example, the preset condition can be set as: the user's age is less than or equal to 25 years old; the preset condition can also be set as: the user's address is in Beijing, Shanghai or Guangzhou, etc. The present disclosure does not make specific limitations on the preset conditions.
[0081] In addition, if the user information meets the preset condition, the target service version identifier is determined to be the service version identifier corresponding to the historical service version; if the user information does not meet the preset condition, the target service version identifier is determined to be the service version identifier corresponding to the upgraded service version.
[0082] In a specific embodiment of the present disclosure, the target version selector corresponding to the target version selector information is run, and the target service version identifier corresponding to the user information is determined by the target version selector. This technical feature can be implemented by any technical coding, and the present disclosure does not specifically limit this. For example, a Java-like pseudo code is used to implement dynamic loading of the target version selector, and the pseudo code description is as follows:
[0083] String loadAndSelect(LookupResponse lookup,RpcRequest rpcRequest){
[0084] String jarUrl=lookup.getVersionSelector();
[0085] / / Comment: Use JDK's URLClassLoader to download the Jar package under the specified URL, and query and load the dynamic loading target version selector
[0086] URLClassLoader loader=new URLClassLoader(new URL[]{new URL(jarUrl)});
[0087] Class<? >selectClass=loader.loadClass(VersionSelector.class);
[0088] VersionSelector selector=selectClass.getConstructor().newInstance();
[0089] / / Comment: Execute target version selector logic
[0090] return selector.select(rpcRequest,lookup.getVersionListing());
[0091] } / / Comment: Returns the target service version identifier
[0092] In an exemplary embodiment of the present disclosure, multiple service instance identifiers corresponding to the target service version identifier are obtained, the target service instance identifier is determined from the multiple service instance identifiers according to the load balancing strategy, and the service instance address corresponding to the target service instance identifier is used to send the service request to the target service instance. The load balancing strategy may be any strategy that can determine the target service instance from multiple service instances, such as obtaining the current number of running files of multiple service instances, and taking the service instance with the smallest number of currently running files as the target service instance, which is not specifically limited in the present disclosure.
[0093] In a specific embodiment of the present disclosure, the pseudo code of the service access terminal is as follows:
[0094] SelectorClient{
[0095] private LookupRespone lookup;
[0096] RpcResponse doRPC(Instance[]instances,RpcService,RpcRequest){
[0097] / / Comment: Determine the target version identifier
[0098] String version=AppletRuntime.loadAndSelect(lookup,rpcRequest);
[0099] Instance[]instances=lookup.getVersionListing().get(version);
[0100] / / Comment: Reuse the existing service access end call, including load balancing strategy
[0101] return RpcClient.doRPC(instances,RpcService,RpcRequest);}
[0102] }
[0103] In an exemplary embodiment of the present disclosure, the service access end receives a response from the target service instance to the service request. Usually, the responses made by the service instances corresponding to the historical service version and the upgraded service version to the service request are also different.
[0104] In a specific embodiment of the present disclosure, Figure 4 A schematic diagram of a process flow of a system upgrade method according to a specific embodiment is shown. Figure 4 As shown, the process at least includes steps S410 to S490, which are described in detail as follows:
[0105] In step S410, an upgrade service version is created using an independent process.
[0106] In an exemplary embodiment of the present disclosure, an independent process is created, and an upgrade service version is independently written using a separate program and process. The upgrade service version can be written using any technology, for example, Java, C, Go, etc., and the present disclosure does not make any specific limitations on this.
[0107] In step S420, the upgraded service version information and the historical service version information are registered to the service registration center.
[0108] In an exemplary embodiment of the present disclosure, the upgrade service version information and the historical service version information are registered in the service version information list in the service registration center, and the upgrade service version information corresponding to the upgrade service version includes the upgrade service identifier, the upgrade service version identifier, the upgrade service instance identifier, and the upgrade service address. The historical service version information corresponds to the historical service version, and the historical service version information includes the historical service identifier, the historical service version identifier, the historical service instance identifier, and the historical service address. Among them, the historical service identifier and the upgrade service identifier are the same, representing the same business service.
[0109] In step S430, a version selector is configured and registered with a service registration center.
[0110] In an exemplary embodiment of the present disclosure, a first version selector corresponding to each service identifier is respectively configured, and the first version selector information corresponding to the first version selector is registered to a version selector list in a service registration center, wherein the version selector list includes one or more service identifiers, and the first version selector information corresponding to each service identifier.
[0111] In an exemplary embodiment of the present disclosure, when creating an upgraded service version, a version selector corresponding to each service instance in the upgraded service version is configured in the upgraded service version, that is, each service instance corresponds to an optional version selector. A second version selector is determined in the optional version selectors; when registering the upgraded service version information and the historical service version information in the service version information list, the second version selector information corresponding to the second version selector is registered in the service version information list.
[0112] In step S440, in response to the service request, the target service version information and the target version selector information are queried according to the target service identifier.
[0113] In an exemplary embodiment of the present disclosure, a service request includes a target service identifier and user information. In response to the service request, a service query instruction is sent to a service registration center through a service access terminal, and the service query instruction includes the target service identifier; the service registration center queries the service version information list for the target service version information corresponding to the target service identifier based on the target service identifier, and queries the version selector list for the first version selector information corresponding to the target service identifier, and uses the first version selector information as the target version selector information; if the first version selector information corresponding to the target service identifier does not exist in the version selector list, the second version selector information corresponding to the target service identifier is queried in the service version information list, and the second version selector information is used as the target version selector information.
[0114] In step S450, the target version selector corresponding to the target version selector information is run, and the target version selector is used to determine whether the user information meets the preset conditions.
[0115] In an exemplary embodiment of the present disclosure, the service access end dynamically loads the target version selector according to the target version selector information, runs the target version selector corresponding to the target version selector information, and executes the target version selector logic.
[0116] In step S460, if the user information meets the preset condition, it is determined that the target service version identifier is the service version identifier corresponding to the upgraded service version.
[0117] In the exemplary embodiments of the present disclosure, the preset condition can be set according to actual conditions, and the present disclosure does not specifically limit the preset condition.
[0118] In step S470, if the user desired information does not satisfy the preset condition, the target service version identifier is determined to be the service version identifier corresponding to the historical service version.
[0119] In an exemplary embodiment of the present disclosure, if the user information meets the preset condition, the target service version identifier is determined to be the service version identifier corresponding to the historical service version; if the user information does not meet the preset condition, the target service version identifier is determined to be the service version identifier corresponding to the upgraded service version.
[0120] In step S480, the service request is sent to the target service instance corresponding to the target service version identifier.
[0121] In an exemplary embodiment of the present disclosure, multiple service instances corresponding to a target service version are obtained, a target service instance is determined from the multiple service instances according to a load balancing strategy, and a service request is sent to the target service instance.
[0122] In step S490, the service access end receives a response from the target service instance to the service request.
[0123] The design principle of the system upgrade method in the embodiment of the present disclosure follows the object-oriented single responsibility and Liskov substitution principle, and realizes three separations:
[0124] First, separate the change code of the upgraded service version from the online code of the historical service version so that the change code can be implemented independently. Specifically, the change code is not constrained by the online code, and the coding language and operating environment of the specific change code can be implemented using any technology.
[0125] Second, the decision factors of the splitter are separated. This embodiment uses the service request, the historical service version, and the upgraded service version as inputs, and the target service version as output, abstracting the version selector into an independent decision function. The decision function is described in pseudo code as:
[0126] public interface VersionSelector
[0127] {
[0128] String select(RpcRequest request,List <string>versions);
[0129] }
[0130] The input parameter RpcRequest represents the service request, from which the target service identifier and user information of the service access end can be extracted; the input parameter List <string>versions represents the list of service version numbers currently available for selection, that is, it includes upgrade service version identifiers and historical service version identifiers; the return value is the target service version identifier, which is one of the historical service version identifier and the upgrade service version identifier.
[0131] Third, the implantation point of the diverter is separated by querying the target service version information and the target version selector information, and running the target version selector corresponding to the target version selector information.
[0132] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above functions defined by the above method provided by the present invention are performed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk.
[0133] In addition, it should be noted that the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0134] The following describes an embodiment of the device of the present disclosure, which can be used to execute the above-mentioned system upgrade method of the present disclosure. For details not disclosed in the embodiment of the device of the present disclosure, please refer to the embodiment of the above-mentioned system upgrade method of the present disclosure.
[0135] Figure 5 A block diagram of a system upgrading device according to an embodiment of the present disclosure is schematically shown.
[0136] Reference Figure 5 As shown, according to an embodiment of the present disclosure, the system upgrade device 500 includes: a registration module 501, a query module 502 and an operation module 503, specifically:
[0137] A registration module 501 is used to create an upgrade service version corresponding to the upgrade service version information by using an independent process, and register the upgrade service version information and the historical service version information in a service version information list in a service registration center, wherein the upgrade service version information and the historical service version information both include a service identifier, a service version identifier, and a service instance identifier;
[0138] A query module 502 is used to respond to a service request, the service request includes a target service identifier and user information, and query a service registration center for a target service version information list corresponding to the target service identifier and target version selector information;
[0139] The running module 503 is used to run the target version selector corresponding to the target version selector information, determine the target service version identifier corresponding to the user information through the target version selector, and send the service request to the target service instance corresponding to the target service version identifier.
[0140] In an exemplary embodiment of the present disclosure, the registration module 501 can also be used to respectively configure the first version selector corresponding to each service identifier, and register the first version selector information corresponding to the first version selector to the version selector list in the service registration center, where the version selector list includes the service identifier and the first version selector information.
[0141] In an exemplary embodiment of the present disclosure, the registration module 501 may also be used to configure a version selector corresponding to each service instance identifier in the upgraded service version, and determine a second version selector in the version selector corresponding to each service instance identifier;
[0142] While registering the upgraded service version information and the historical service version information into the service version information list, the second version selector information corresponding to the second version selector is registered into the service version information list.
[0143] In an exemplary embodiment of the present disclosure, the query module 502 can also be used to send a service query instruction to the service registration center through the service access terminal, and the service query instruction includes a target service identifier, so that the service registration center outputs the target service version information corresponding to the target service identifier and the target version selector information according to the service query instruction.
[0144] In an exemplary embodiment of the present disclosure, the query module 502 can also be used to query the target service version information corresponding to the target service identifier in the service version information list, and to query the first version selector information corresponding to the target service identifier in the version selector list, and configure the first version selector information as the target version selector information.
[0145] In an exemplary embodiment of the present disclosure, the query module 502 can also be used to query the second version selector information corresponding to the target service identifier in the service version information list if the first version selector information corresponding to the target service identifier does not exist in the version selector list, and configure the second version selector information as the target version selector information.
[0146] In an exemplary embodiment of the present disclosure, the operation module 503 may also be used to determine whether the user information meets a preset condition through a target version selector;
[0147] If so, determining that the target service version identifier is the service version identifier corresponding to the upgraded service version;
[0148] If not, it is determined that the target service version identifier is the service version identifier corresponding to the historical service version.
[0149] In an exemplary embodiment of the present disclosure, the operation module 503 can also be used to obtain multiple service instance identifiers corresponding to the target service version identifier, determine the target service instance identifier among the multiple service instance identifiers according to the load balancing strategy, and send the service request to the target service instance according to the service instance address corresponding to the target service instance identifier, wherein the upgraded service version information and the historical service version information also include the service instance address corresponding to the service instance identifier.
[0150] In an exemplary embodiment of the present disclosure, the system upgrade device 500 may further include a selector registration module (not shown in the figure), which is used to respectively configure a first version selector corresponding to each service identifier, and register the first version selector information corresponding to the first version selector to a version selector list in a service registration center, wherein the version selector list includes the service identifier and the first version selector information.
[0151] In an exemplary embodiment of the present disclosure, the selector registration module may also be used to configure a version selector corresponding to each service instance identifier in the upgraded service version, and determine a second version selector in the version selector corresponding to each service instance identifier;
[0152] While registering the upgraded service version information and the historical service version information into the service version information list, the second version selector information corresponding to the second version selector is registered into the service version information list.
[0153] The specific details of each of the above system upgrade devices have been described in detail in the corresponding system upgrade method, so they will not be repeated here.
[0154] Figure 6 A block diagram of a service system according to an embodiment of the present disclosure is schematically shown.
[0155] Reference Figure 6 As shown, according to a service system 600 of an embodiment of the present disclosure, the service system 600 includes: an upgrade service provider 610, a history service provider 620, a service registration center 630 and a service access terminal 640, specifically:
[0156] The upgrade service provider 610 is used to create an upgrade service version according to the upgrade service version information and register the upgrade service version information with the service registration center. The upgrade service version information includes the upgrade service identifier, the upgrade service version identifier, and the upgrade service instance identifier.
[0157] The historical service provider 620 is used to create a historical service version according to the historical service version information and register the historical service version information with the service registration center. The historical service version information includes a historical service identifier, a historical service version identifier, and a historical service instance identifier.
[0158] The service registration center 630 is used to store the upgraded service version information and the historical service version information in the service version information list;
[0159] The service access terminal 640 is used to respond to the service request, determine the target service version information and the target version selector information according to the service request, and run the target version selector corresponding to the target version selector information, and determine the target service version identifier corresponding to the user information through the target version selector.
[0160] In an exemplary embodiment of the present disclosure, the service access terminal 640 includes an information query unit and a script execution unit, wherein:
[0161] An information query unit, used to respond to a service request, the service request includes user information and a target service identifier, and query the target service version information corresponding to the target service identifier and the target version selector information in the service registration center according to the target service identifier;
[0162] The script running unit is used to run the target version selector, determine whether the user information meets the preset conditions through the target version selector, and determine the target service version identifier according to the determination result.
[0163] In an exemplary embodiment of the present disclosure, the service registration center 630 may also be used to save the first version selector information corresponding to each service identifier into a version selector list, where the version selector list includes the service identifier and the first version selector information.
[0164] In an exemplary embodiment of the present disclosure, the service registration center 630 may also be used to save the second version selector information determined according to the version selector corresponding to each service instance identifier into the service version information list.
[0165] In an exemplary embodiment of the present disclosure, the information query unit can also be used to send a service query instruction to the service registration center 630, the service query instruction including a target service identifier, so that the service registration center outputs the target service version information corresponding to the target service identifier and the target version selector information according to the service query instruction.
[0166] In an exemplary embodiment of the present disclosure, the information query unit may also be used to query target service version information corresponding to a target service identifier in a service version information list, and query first version selector information corresponding to the target service identifier in a version selector list, and configure the first version selector information as target version selector information.
[0167] In an exemplary embodiment of the present disclosure, if there is no first version selector information corresponding to the target service identifier in the version selector list, the information query unit may also be used to query second version selector information corresponding to the target service identifier in the service version information list, and configure the second version selector information as target version selector information.
[0168] In an exemplary embodiment of the present disclosure, Figure 7 shows a Unified Modeling Language (UML) diagram for upgrading the present service system, as Figure 7 shown, this process at least includes steps S710 to S770, which are introduced in detail as follows:
[0169] In step S710, the upgrade service provider 610 registers upgrade service version information in the service registration center 630, and the historical service provider 620 registers historical service version information in the service registration center 630.
[0170] Among them, the upgrade service version information includes: S#A.V#B.I#4, S#A.V#B.I#5; the historical service version information includes: S#A.V#A.I#1, S#A.V#A.I#2, S#A.V#A.I#3.
[0171] In addition, first version selectors corresponding to each service identifier are respectively configured, and the first version selector information corresponding to the first version selector is registered in the service registration center 630.
[0172] In step S720, the service registration center 630 saves the upgrade service version information and the historical service version information to the service version information list.
[0173] In step S730, the information query unit 641 sends a query instruction to the service registration center 630 according to a service request to query target service version information corresponding to a target service identifier, and target version selector information.
[0174] In step S740, the service registration center 630 returns the target service version information and the target version selector information to the service access end 640.
[0175] In step S750, the script execution unit 642 executes the target version selector corresponding to the target version selector information, determines whether the user information meets the preset condition through the target version selector, and determines the target service version identifier according to the determination result.
[0176] In step S760 , if the target service version is identified as an upgrade service version, the service request is sent to the upgrade service provider 610 .
[0177] In step S770 , if the target service version is identified as a historical service version, the service request is sent to the historical service provider 620 .
[0178] The specific details of the above service systems have been described in detail in the corresponding system upgrade methods, so they will not be repeated here.
[0179] It should be noted that, although several modules or units of the device for execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0180] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0181] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0182] Refer to the following Figure 8 An electronic device 800 according to this embodiment of the present invention will be described. Figure 8 The electronic device 800 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0183] like Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one storage unit 820, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), and a display unit 840.
[0184] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification. For example, the processing unit 810 can perform the following steps: Figure 2 In step S210 shown in the figure, an upgrade service version corresponding to the upgrade service version information is created by using an independent process, and the upgrade service version information and the historical service version information are registered in the service version information list in the service registration center, where both the upgrade service version information and the historical service version information include a service identifier, a service version identifier, and a service instance identifier; in step S220, a service request is responded to, where the service request includes a target service identifier and user information, and the target service version information corresponding to the target service identifier and the target version selector information are queried in the service registration center; in step S230, a target version selector corresponding to the target version selector information is run, and the target service version identifier corresponding to the user information is determined through the target version selector, and the service request is sent to the target service instance corresponding to the target service version identifier.
[0185] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .
[0186] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0187] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0188] The electronic device 800 may also communicate with one or more external devices 1000 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable viewers to interact with the electronic device 800, and / or communicate with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0189] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0190] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present invention described in the above "Exemplary Method" section of the present specification.
[0191] refer to Fig. 9 As shown, a program product 900 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0192] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0193] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0194] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0195] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0196] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0197] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0198] It should be understood that the present disclosure is not limited to the exact structures that have been 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 present disclosure is limited only by the appended claims.< / string> < / string>
Claims
1. A system upgrade method, characterized in that: include: Using an independent process to create an upgrade service version corresponding to the upgrade service version information, and registering the upgrade service version information and the historical service version information in a service version information list in a service registration center, wherein the upgrade service version information and the historical service version information both include a service identifier, a service version identifier, and a service instance identifier; In response to a service request, the service request includes a target service identifier and user information, and querying the service registration center for target service version information corresponding to the target service identifier and target version selector information, wherein the target version selector information includes first version selector information or second version selector information; Running the target version selector corresponding to the target version selector information, determining the target service version identifier corresponding to the user information through the target version selector, and sending the service request to the target service instance corresponding to the target service version identifier; The method further comprises: Respectively configure a first version selector corresponding to each of the service identifiers, and register the first version selector information corresponding to the first version selector to a version selector list in the service registration center, wherein the version selector list includes the service identifier and the first version selector information; or, configure a version selector corresponding to each of the service instance identifiers in the upgraded service version, and determine a second version selector in the version selector corresponding to each of the service instance identifiers; while registering the upgraded service version information and the historical service version information in the service version information list, register the second version selector information corresponding to the second version selector in the service version information list.
2. The system upgrade method according to claim 1, characterized in that: Querying the target service version information corresponding to the target service identifier and the target version selector information in the service registration center includes: A service query instruction is sent to the service registration center through the service access terminal, and the service query instruction includes the target service identifier, so that the service registration center outputs the target service version information corresponding to the target service identifier and the target version selector information according to the service query instruction.
3. The system upgrade method according to claim 1, characterized in that: Querying the target service version information corresponding to the target service identifier and the target version selector information in the service registration center includes: The target service version information corresponding to the target service identifier is searched in the service version information list, and the first version selector information corresponding to the target service identifier is searched in the version selector list, and the first version selector information is configured as the target version selector information.
4. The system upgrade method according to claim 3, characterized in that: The method further comprises: If the first version selector information corresponding to the target service identifier does not exist in the version selector list, the second version selector information corresponding to the target service identifier is searched in the service version information list, and the second version selector information is configured as the target version selector information.
5. The system upgrade method according to claim 1, characterized in that: Running the target version selector corresponding to the target version selector information, and determining the target service version identifier corresponding to the user information through the target version selector, including: Determining whether the user information meets a preset condition by using the target version selector; If yes, determining that the target service version identifier is the service version identifier corresponding to the upgraded service version; If not, it is determined that the target service version identifier is the service version identifier corresponding to the historical service version.
6. The system upgrade method according to claim 1, characterized in that: The upgraded service version information and the historical service version information also include a service instance address corresponding to the service instance identifier; Sending the service request to a target service instance corresponding to the target service version identifier includes: Obtain multiple service instance identifiers corresponding to the target service version identifier, determine the target service instance identifier among the multiple service instance identifiers according to the load balancing strategy, and the service instance address corresponding to the target service instance identifier, and send the service request to the target service instance.
7. A system upgrade device, characterized in that: include: A registration module, used to create an upgrade service version corresponding to the upgrade service version information by using an independent process, and register the upgrade service version information and the historical service version information in the service version information list in the service registration center, wherein the upgrade service version information and the historical service version information both include a service identifier, a service version identifier, and a service instance identifier; A query module, used to respond to a service request, wherein the service request includes a target service identifier and user information, and query the service registration center for a target service version information list corresponding to the target service identifier, and target version selector information, wherein the target version selector information includes first version selector information or second version selector information; an operating module, configured to operate the target version selector corresponding to the target version selector information, determine the target service version identifier corresponding to the user information through the target version selector, and send the service request to the target service instance corresponding to the target service version identifier; The registration module is also used to respectively configure a first version selector corresponding to each of the service identifiers, and register the first version selector information corresponding to the first version selector to a version selector list in the service registration center, wherein the version selector list includes the service identifier and the first version selector information; or, configure a version selector corresponding to each of the service instance identifiers in the upgraded service version, and determine a second version selector in the version selector corresponding to each of the service instance identifiers; and register the second version selector information corresponding to the second version selector to the service version information list while registering the upgraded service version information and the historical service version information to the service version information list.
8. A service system, characterized in that: The service system includes an upgrade service provider, a history service provider, a service registration center, and a service access terminal, wherein: The upgrade service provider is used to create an upgrade service version according to the upgrade service version information, and register the upgrade service version information with the service registration center, wherein the upgrade service version information includes an upgrade service identifier, an upgrade service version identifier, and an upgrade service instance identifier; The historical service provider is used to create a historical service version according to the historical service version information, and register the historical service version information with the service registration center, wherein the historical service version information includes a historical service identifier, a historical service version identifier, and a historical service instance identifier; The service registration center is used to store the upgraded service version information and the historical service version information in a service version information list; The service access end is used to respond to the service request, determine the target service version information and the target version selector information according to the service request, and run the target version selector corresponding to the target version selector information, and determine the target service version identifier corresponding to the user information through the target version selector, wherein the target version selector information includes the first version selector information or the second version selector information; The service registration center is also used to save the first version selector information corresponding to each service identifier into a version selector list, where the version selector list includes the service identifier and the first version selector information, or to save the second version selector information determined according to the version selector corresponding to each service instance identifier into a service version information list.
9. The service system according to claim 8, characterized in that: The service access terminal includes an information query unit and a script execution unit, wherein: The information query unit is used to respond to a service request, wherein the service request includes user information and a target service identifier, and query the service registration center for target service version information corresponding to the target service identifier and target version selector information according to the target service identifier; The script running unit is used to run the target version selector, determine whether the user information meets a preset condition through the target version selector, and determine the target service version identifier according to the determination result.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the system upgrade method according to any one of claims 1 to 6 is implemented.
11. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the system upgrade method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for smooth upgrade of service system
CN106130798A
Gray release method and processing method thereof, node, system and storage device
CN110661835A
