CN113495747B - Gray scale release method and device - Google Patents
Gray scale release method and device Download PDFInfo
- Publication number
- CN113495747B CN113495747B CN202010265347.4A CN202010265347A CN113495747B CN 113495747 B CN113495747 B CN 113495747B CN 202010265347 A CN202010265347 A CN 202010265347A CN 113495747 B CN113495747 B CN 113495747B
- Authority
- CN
- China
- Prior art keywords
- shunt
- component
- distribution
- configuration information
- configuration
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 113
- 238000012544 monitoring process Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 9
- 238000011161 development Methods 0.000 abstract description 13
- 238000010586 diagram Methods 0.000 description 17
- 230000006870 function Effects 0.000 description 12
- 230000008569 process Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008520 organization Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 235000010627 Phaseolus vulgaris Nutrition 0.000 description 1
- 244000046052 Phaseolus vulgaris Species 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a gray level publishing method and device, and relates to the technical field of computers. One embodiment of the method comprises the following steps: receiving and analyzing a service request to obtain a service field and corresponding service parameters thereof; intercepting method call of a shunting assembly, and judging whether shunting configuration information of the shunting assembly is locally stored or not; if yes, matching the component realization class name of the target version from the distribution configuration information according to the service field and the corresponding service parameters thereof, so as to call a method corresponding to the component realization class name of the target version. The implementation mode can solve the technical problems of large development workload, poor maintainability or occupation of more hardware resources.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a gray level publishing method and device.
Background
The gray level release means that when a system has new requirements and needs to be on line, all users are enabled to use new functions instead of full online, but by setting a specific distribution rule, part of users are enabled to try out the new functions first, other users use old functions, whether the new functions meet expected requirements is analyzed through various system logs, product perfection is carried out according to feedback results, and new gray level release or complete release is carried out.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
1) The workload of developers is large, the distribution rules of the system are scattered around the system, cannot be managed uniformly, and the maintainability is poor;
2) More hardware resources are required, and multiple sets of branch codes need to be maintained, resulting in complex code branch management.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a gray level publishing method and device, which are used for solving the technical problems of large development workload, poor maintainability or occupation of more hardware resources.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a gray scale distribution method applied to an application container, including:
receiving and analyzing a service request to obtain a service field and corresponding service parameters thereof;
intercepting method call of a shunting assembly, and judging whether shunting configuration information of the shunting assembly is locally stored or not;
if yes, matching the component realization class name of the target version from the distribution configuration information according to the service field and the corresponding service parameters thereof, so as to call a method corresponding to the component realization class name of the target version.
Optionally, according to the service field and the corresponding service parameter, a component implementation class name of the target version is matched from the shunting configuration information, including:
determining a target distribution condition according to each service field and the corresponding service parameter;
and matching the component realization class name of the corresponding target version from the shunt configuration information according to the target shunt condition.
Optionally, before receiving and parsing the service request, the method further includes:
starting an application container, and finding out a shunting component added with multi-version notes in application codes;
registering each shunt assembly to a shunt configuration center according to a shunt configuration address of the shunt configuration center; wherein the registration information of the shunt component includes: the address of the application container, the component realization class names of the versions corresponding to the shunt components and the method names thereof.
Optionally, the registration information of the shunting component further includes a callback port;
after registering each of the shunt components to the shunt configuration center according to the shunt configuration address of the shunt configuration center, the method further comprises:
and monitoring whether the distribution configuration information of the distribution component is updated or not through a callback port.
Optionally, after monitoring whether the split configuration information of the split component is updated through the callback port, the method further includes:
receiving a configuration update message sent by the shunt configuration center;
pulling the corresponding shunt configuration information of each shunt component from the shunt configuration center and storing the shunt configuration information in a local place;
the distribution configuration information comprises the corresponding relation between each distribution condition and each version of component realization class name, and the distribution condition comprises the combination of parameter information of at least one service field.
Optionally, after registering each of the shunt components to the shunt configuration center according to the shunt configuration address of the shunt configuration center, the method further includes:
and regularly refreshing the registration information of each shunt component in the shunt configuration center through a timing task.
Optionally, the method further comprises: if not, calling a method before intercepting the shunt component.
Optionally, the method further comprises: after the method call is finished, recording a call log;
the call log comprises called components, versions of the called components and corresponding call results.
In addition, according to another aspect of the embodiment of the present invention, there is provided a gradation issuing apparatus provided to an application container, including:
The receiving module is used for receiving and analyzing the service request to obtain a service field and corresponding service parameters thereof;
the calling module is used for intercepting the method call of the shunting assembly and judging whether shunting configuration information of the shunting assembly is locally stored or not; if yes, matching the component realization class name of the target version from the distribution configuration information according to the service field and the corresponding service parameters thereof, so as to call a method corresponding to the component realization class name of the target version.
Optionally, the calling module is further configured to:
determining a target distribution condition according to each service field and the corresponding service parameter;
and matching the component realization class name of the corresponding target version from the shunt configuration information according to the target shunt condition.
Optionally, the system further comprises a registration module for:
before receiving and analyzing the service request, starting an application container, and finding out a shunting component added with multi-version notes in an application code;
registering each shunt assembly to a shunt configuration center according to a shunt configuration address of the shunt configuration center; wherein the registration information of the shunt component includes: the address of the application container, the component realization class names of the versions corresponding to the shunt components and the method names thereof.
Optionally, the registration information of the shunting component further includes a callback port;
the system also comprises a monitoring module for: and after registering each shunting assembly to the shunting configuration center according to the shunting configuration address of the shunting configuration center, monitoring whether the shunting configuration information of the shunting assembly is updated or not through a callback port.
Optionally, the listening module is further configured to:
after monitoring whether the distribution configuration information of the distribution assembly is updated or not through a callback port, receiving a configuration update message sent by the distribution configuration center;
pulling the corresponding shunt configuration information of each shunt component from the shunt configuration center and storing the shunt configuration information in a local place;
the distribution configuration information comprises the corresponding relation between each distribution condition and each version of component realization class name, and the distribution condition comprises the combination of parameter information of at least one service field.
Optionally, the registration module is further configured to:
and after registering each shunt component to the shunt configuration center according to the shunt configuration address of the shunt configuration center, regularly refreshing the registration information of each shunt component in the shunt configuration center through a timing task.
Optionally, the calling module is further configured to: if not, calling a method before intercepting the shunt component.
Optionally, the calling module is further configured to: after the method call is finished, recording a call log; the call log comprises called components, versions of the called components and corresponding call results.
According to another aspect of an embodiment of the present invention, there is also provided an electronic device including:
one or more processors;
storage means for storing one or more programs,
the one or more processors implement the method of any of the embodiments described above when the one or more programs are executed by the one or more processors.
According to another aspect of an embodiment of the present invention, there is also provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method according to any of the embodiments described above.
One embodiment of the above invention has the following advantages or benefits: because the method call of the shunt assembly is intercepted, whether the shunt configuration information of the shunt assembly is stored locally or not is judged, if yes, the assembly realization class name of the target version is matched, and the technical means of the corresponding method is called, and therefore the technical problems of large development workload, poor maintainability or more hardware resources occupation in the prior art are solved. According to the embodiment of the invention, the distribution configuration information of each distribution assembly is uniformly configured through the distribution configuration center, so that the distribution configuration information is easier to maintain; and code control shunt logic is not needed, development workload is reduced, independent gray level grouping is not needed, server resources are saved, independent branch codes are not needed to be established, and branch code management is simplified. Therefore, the embodiment of the invention can flexibly and efficiently complete the gray level release of the system without increasing hardware consumption, introducing extra code branches and increasing system switches, simplifies the difficulty of shunt realization and reduces the workload of shunt realization.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a gray scale distribution method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the main flow of a gray scale distribution method according to one referenceable embodiment of the present invention;
FIG. 3 is a schematic diagram of a framework of a gray scale distribution system according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main flow of a gray scale distribution method according to another exemplary embodiment of the present invention;
fig. 5 is a schematic diagram of main modules of a gradation issuing apparatus according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 7 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The gray level release is more in the use of internet enterprise, because the system user volume of internet enterprise is big, and the frequency of system release is high, if new demand direct online, can lead to the system to take place large tracts of land trouble, perhaps arouse the experience of a large amount of users and change, probably produce large tracts of land customer complaint, so through the mode of gray level release, the new demand of step by step verifies, can keep online system's stability.
Fig. 1 is a schematic diagram of a main flow of a gray scale distribution method according to an embodiment of the present invention. As an embodiment of the present invention, as shown in fig. 1, the gray scale distribution method is applied to an application container, and may include the steps of:
step 101, receiving and analyzing the service request to obtain the service field and the corresponding service parameters.
Optionally, the application container receives the service request sent by the terminal and analyzes the service request, thereby obtaining the service field carried in the request and the corresponding service parameters thereof. Alternatively, the service field may be a user account, an IP on which the user logs, a quaternary address to which the user belongs, an organization to which the user belongs, a merchant code or a vendor code, etc., and multiple fields may be carried in the request.
102, intercepting a method call of a shunting assembly, and judging whether shunting configuration information of the shunting assembly is locally stored or not; if yes, go to step 103.
After a certain shunting component in the application code is added with multi-version annotation (such as section-oriented programming annotation), in the process of running the application code, an application container intercepts a method call to the shunting component and then judges whether a local virtual machine stores shunting configuration information of the shunting component. It should be noted that the split configuration information of each split component is configured in the split configuration center by the developer, so before executing step 101, the application container needs to store the split configuration information of each split component locally.
Optionally, before step 101, the method further includes: starting an application container, and finding out a shunting component added with multi-version notes in application codes; and registering each shunt component to the shunt configuration center according to the shunt configuration address of the shunt configuration center. Wherein the registration information of the shunt component includes: the address of the application container, the component realization class names of the versions corresponding to the shunt components and the method names thereof. When the application container is started, service components (namely, shunting components) added with multi-version notes in all application codes are searched, and each shunting component is registered to a shunting configuration center by calling a shunting configuration address provided by the shunting configuration center. The registered information mainly comprises the IP address of the application container, the component realization class names of the versions corresponding to the shunt components, the method names of the component realization class names, callback ports and the like. In an embodiment of the invention, the components include classes and interfaces. In general, in order to implement gray level distribution, each of the split components has multiple versions, so that each version of component implementation class name and method name thereof need to be registered in the split configuration center, so that a developer can conveniently configure split configuration information of the split component according to the registered multiple versions of split components.
Optionally, after registering each of the shunt components to the shunt configuration center according to the shunt configuration address of the shunt configuration center, the method further includes: and monitoring whether the distribution configuration information of the distribution component is updated or not through a callback port. Optionally, the method further comprises: receiving a configuration update message sent by the shunt configuration center; and pulling the distribution configuration information corresponding to each distribution component from the distribution configuration center and storing the distribution configuration information in a local place. The distribution configuration information comprises the corresponding relation between each distribution condition and each version of component realization class name, and the distribution condition comprises the combination of parameter information of at least one service field. Optionally, the service field may be a user account, an IP on which the user logs, a quaternary address to which the user belongs, an organization structure to which the user belongs, a merchant code or a vendor code, and the distribution condition is also configured by the developer.
When the distribution configuration information of the distribution configuration center is changed, the distribution configuration center informs the application container through the callback port, and after the application container receives the configuration update message, the distribution configuration information of the distribution assembly is pulled from the distribution configuration center and stored in the local virtual machine, so that multi-version management of the same service assembly in one virtual machine is realized.
It should be noted that the application container may pull the split configuration information of all the split components from the split configuration center, or may pull only the split configuration information of the split components that are updated. Optionally, the application container may invoke a query service of the offload configuration center to query offload configurations of various offload components of the application container, and then offload configuration information is refreshed into the local virtual machine for storage.
Step 103, matching the component realization class name of the target version from the distribution configuration information according to the service field and the corresponding service parameters thereof, thereby calling the method corresponding to the component realization class name of the target version.
If the distribution configuration information of the distribution component is locally stored, the component realization class (i.e. bean) name of the target version of the distribution component is matched from the distribution configuration information according to each service field and the corresponding service parameter obtained by analysis in the step 101, so that a method corresponding to the component realization class name of the version is called.
Optionally, according to the service field and the corresponding service parameter, a component implementation class name of the target version is matched from the shunting configuration information, including: determining a target distribution condition according to each service field and the corresponding service parameter; and matching the component realization class name of the corresponding target version from the shunt configuration information according to the target shunt condition. Because the distribution configuration information comprises the corresponding relation between each distribution condition and each version of component realization class name, the service parameter in the request is used for judging which distribution condition is satisfied, so that the target distribution condition is determined, and then the component realization class name of the target version of the distribution component is matched according to the corresponding relation between each distribution condition and each version of component realization class name.
Optionally, if the shunt configuration information of the shunt component is not stored locally, which indicates that the shunt component is not required to be shunted, a method before intercepting the shunt component is directly invoked.
Optionally, the method further comprises: after the method call is finished, recording a call log; the call log comprises called components, versions of the called components and corresponding call results. The call log can be used for knowing which components are called, which versions of which components are called, the calling results of each component and the like in the process of running the application code, so that whether a new function meets the expected requirement can be conveniently analyzed, the product is perfected according to the feedback result, and a new round of gray level release or complete release is performed.
According to the various embodiments described above, it can be seen that the embodiments of the present invention determine whether the split configuration information of the split component is locally stored by intercepting the method call to the split component, and if yes, match the component implementation class name of the target version, thereby invoking the technical means of the corresponding method, and solving the technical problems of large development workload, poor maintainability or occupation of more hardware resources in the prior art. According to the embodiment of the invention, the distribution configuration information of each distribution assembly is uniformly configured through the distribution configuration center, so that the distribution configuration information is easier to maintain; and code control shunt logic is not needed, development workload is reduced, independent gray level grouping is not needed, server resources are saved, independent branch codes are not needed to be established, and branch code management is simplified. Therefore, the embodiment of the invention can flexibly and efficiently complete the gray level release of the system without increasing hardware consumption, introducing extra code branches and increasing system switches, simplifies the difficulty of shunt realization and reduces the workload of shunt realization.
Fig. 2 is a schematic diagram of the main flow of the gray scale distribution method according to one referenceable embodiment of the present invention. As still another embodiment of the present invention, as shown in fig. 2, the gray scale distribution method is applied to an application container, and may include the steps of:
step 201, starting an application container, and finding out a shunting component added with multi-version notes in application codes.
Firstly, deploying application codes into an application container, and after the application container is started, searching out service components added with multi-version notes in the application codes, wherein the service components are used as classification components.
And 202, registering each shunt component to the shunt configuration center according to the shunt configuration address of the shunt configuration center.
Each of the offload components is registered with the offload configuration center by invoking offload configuration addresses provided by the offload configuration center. The registered information mainly comprises an IP address of an application container, component realization class names of various versions corresponding to various shunt components, method names thereof, callback ports and the like.
And 203, monitoring whether the distribution configuration information of the distribution component is updated or not through a callback port.
And monitoring port information by using the container, and judging whether the distribution configuration information of the distribution assembly configured on the distribution configuration center is changed or not.
And step 204, receiving a configuration update message sent by the shunt configuration center.
And step 205, pulling the shunt configuration information corresponding to each shunt component from the shunt configuration center and storing the shunt configuration information locally.
When the distribution configuration information of the distribution configuration center is changed, the distribution configuration center informs the application container through the callback port, and after the application container receives the configuration update message, the distribution configuration information of the distribution assembly is pulled from the distribution configuration center and stored in the local virtual machine.
The distribution configuration information of each distribution component is configured in a distribution configuration center by a developer, the distribution configuration information comprises the corresponding relation between each distribution condition and the component realization class name of each version, and the distribution condition comprises the combination of the parameter information of at least one service field.
And 206, receiving and analyzing the service request to obtain the service field and the corresponding service parameters.
Step 207, intercepting a method call to a shunt component, and judging whether shunt configuration information of the shunt component is locally stored; if yes, go to step 208; if not, go to step 209.
After a certain shunting component in the application code is added with multi-version annotation, in the process of running the application code, an application container intercepts a method call to the shunting component and then judges whether a local virtual machine stores shunting configuration information of the shunting component.
Step 208, matching the component realization class name of the target version from the distribution configuration information according to the service field and the corresponding service parameters thereof, thereby calling the method corresponding to the component realization class name of the target version.
Because the distribution configuration information comprises the corresponding relation between each distribution condition and the component realization class name of each version, the service parameter in the request meets which distribution condition, so that the target distribution condition is determined, and then the component realization class name of the target version of the distribution component is matched according to the corresponding relation between each distribution condition and the component realization class name of each version.
Step 209, calling a method before intercepting the splitting component.
And if the distribution configuration information of the distribution component is not stored locally, and the distribution component is not required to be distributed, directly calling a method before intercepting the distribution component.
Step 210, a call log is recorded. The call log comprises called components, versions of the called components and corresponding call results. The embodiment of the invention records the log of the multi-version component execution, and can inquire the call log through the identifier to confirm the information of which components are called, which version of the components are called for execution, the calling result and the like in the execution process of the application code. Whether the new function meets the expected requirement is conveniently analyzed, the product is perfected according to the feedback result, and a new round of gray level release or complete release is carried out.
In addition, in the embodiment of the present invention, the implementation of the gray scale distribution method has been described in detail in the above-mentioned gray scale distribution method, and thus the description thereof will not be repeated here.
Fig. 3 is a schematic diagram of a framework of a gray scale distribution system according to an embodiment of the present invention. As shown in fig. 3, the gray level publishing system includes a distribution module, an application container (such as a Spring container), a distribution configuration center, a log module, a building module, a development plug-in module (such as an IDEA development tool), and the like. The distribution module mainly comprises a distribution control interceptor, a distribution node register and a distribution configuration updater.
Fig. 4 is a schematic diagram of the main flow of a gray scale distribution method according to another exemplary embodiment of the present invention. As another embodiment of the present invention, as shown in fig. 4, the gray scale distribution method is applied to an application container, and may include the steps of:
step 401, a developer writes a multi-version implementation class of a service component through a development plug-in module, and adds multi-version control AOP annotation to the service component needing multi-version control, so as to obtain an application code (a callback port, an application code demoApp and the like are also required to be configured in a configuration file of the application code); and then referencing a shunting module (the shunting module exists in the form of jar software package) in the application code, and configuring a shunting configuration address of a shunting configuration center in the configuration file.
It is noted that which business components need to be forked, annotations are added to which business components for intercepting calls to those business components.
In step 402, the application code, the splitting module, the configuration file, and the like are packaged into an executable program by adopting the construction module, and the executable program is deployed into an application container.
In step 403, after the application container is started, the splitting node register searches the service component (i.e. splitting component) added with the multi-version annotation in the application code, and then registers the splitting component added with the multi-version annotation to the splitting configuration center according to the splitting configuration address. Wherein the registration information includes: the IP address of the application container, the component realization class name of each version corresponding to each shunt component, the method name, the callback port and the like.
After the container is started, the shunting node register also calls the shunting configuration address through the timing task to register each shunting component to the shunting configuration center, so that the shunting configuration center knows the state (stop or operation) of the application container.
At step 404, a developer configures the offload configuration information for the offload component of the application container on an interface of the offload configuration center.
The distribution configuration information comprises the corresponding relation between each distribution condition and each version of component realization class name, and the distribution condition comprises the combination of parameter information of at least one service field. Optionally, the service field may be a user account, an IP on which the user logs, a quaternary address to which the user belongs, an organization structure to which the user belongs, a merchant code or a vendor code, and the distribution condition is also configured by the developer. The meaning of the split configuration information is: and executing the method of the component realization class of the corresponding version when the service field or the service field combination meets a certain shunting condition.
Two states may be configured for the split configuration information: the method comprises an initial state and an enabled state, wherein the initial state indicates that the shunt configuration information is not effective, and the enabled state indicates that the shunt configuration information is effective. After clicking the enabling button, the state is changed into the enabling state, and after clicking the disabling state, the state is changed into the initial state.
In step 405, the split configuration updater monitors port information, and when the split configuration information of the split configuration center is changed, the split configuration center notifies the split configuration updater through the callback port, and after the split configuration updater receives the configuration update message, the split configuration information of the split component is pulled from the split configuration center and stored in the local virtual machine.
In step 406, the application container receives the service request, analyzes the service request to obtain a service parameter, intercepts a method call to the splitting component by the splitting control interceptor in the process of running the code, and then judges whether the local virtual machine stores splitting configuration information of the splitting component.
If the distribution configuration information of the distribution component is locally stored, judging which distribution condition is met according to each service field and the corresponding service parameter of the service field obtained by analyzing the request, and then matching the component realization class name of the target version of the distribution component from the distribution configuration information, so that a method corresponding to the component realization class name of the version is called.
And if the distribution configuration information of the distribution component is not stored locally, and the distribution component is not required to be distributed, directly calling a method before intercepting the distribution component.
Step 407, after the method call is completed, the log module records a call log, where the call log includes the called component, the version of the called component, and the corresponding call result.
In addition, in another embodiment of the present invention, the implementation of the gray scale distribution method is described in detail in the above-mentioned gray scale distribution method, and thus the description thereof will not be repeated here.
Fig. 5 is a schematic diagram of main modules of a gray scale distribution device according to an embodiment of the present invention, and as shown in fig. 5, the gray scale distribution device 500 is disposed in an application container, and includes a receiving module 501 and a calling module 502; the receiving module 501 is configured to receive and parse a service request to obtain a service field and a corresponding service parameter thereof; the calling module 502 is configured to intercept a method call to a splitting component, and determine whether splitting configuration information of the splitting component is locally stored; if yes, matching the component realization class name of the target version from the distribution configuration information according to the service field and the corresponding service parameters thereof, so as to call a method corresponding to the component realization class name of the target version.
Optionally, the calling module 502 is further configured to:
determining a target distribution condition according to each service field and the corresponding service parameter;
and matching the component realization class name of the corresponding target version from the shunt configuration information according to the target shunt condition.
Optionally, the system further comprises a registration module for:
before receiving and analyzing the service request, starting an application container, and finding out a shunting component added with multi-version notes in an application code;
Registering each shunt assembly to a shunt configuration center according to a shunt configuration address of the shunt configuration center; wherein the registration information of the shunt component includes: the address of the application container, the component realization class names of the versions corresponding to the shunt components and the method names thereof.
Optionally, the registration information of the shunting component further includes a callback port;
the system also comprises a monitoring module for: and after registering each shunting assembly to the shunting configuration center according to the shunting configuration address of the shunting configuration center, monitoring whether the shunting configuration information of the shunting assembly is updated or not through a callback port.
Optionally, the listening module is further configured to:
after monitoring whether the distribution configuration information of the distribution assembly is updated or not through a callback port, receiving a configuration update message sent by the distribution configuration center;
pulling the corresponding shunt configuration information of each shunt component from the shunt configuration center and storing the shunt configuration information in a local place;
the distribution configuration information comprises the corresponding relation between each distribution condition and each version of component realization class name, and the distribution condition comprises the combination of parameter information of at least one service field.
Optionally, the registration module is further configured to:
and after registering each shunt component to the shunt configuration center according to the shunt configuration address of the shunt configuration center, regularly refreshing the registration information of each shunt component in the shunt configuration center through a timing task.
Optionally, the calling module 502 is further configured to: if not, calling a method before intercepting the shunt component.
Optionally, the calling module 502 is further configured to: after the method call is finished, recording a call log; the call log comprises called components, versions of the called components and corresponding call results.
According to the various embodiments described above, it can be seen that the embodiments of the present invention determine whether the split configuration information of the split component is locally stored by intercepting the method call to the split component, and if yes, match the component implementation class name of the target version, thereby invoking the technical means of the corresponding method, and solving the technical problems of large development workload, poor maintainability or occupation of more hardware resources in the prior art. According to the embodiment of the invention, the distribution configuration information of each distribution assembly is uniformly configured through the distribution configuration center, so that the distribution configuration information is easier to maintain; and code control shunt logic is not needed, development workload is reduced, independent gray level grouping is not needed, server resources are saved, independent branch codes are not needed to be established, and branch code management is simplified. Therefore, the embodiment of the invention can flexibly and efficiently complete the gray level release of the system without increasing hardware consumption, introducing extra code branches and increasing system switches, simplifies the difficulty of shunt realization and reduces the workload of shunt realization.
The specific implementation of the gradation release device according to the present invention is described in detail in the gradation release method described above, and therefore, the description thereof will not be repeated here.
Fig. 6 illustrates an exemplary system architecture 600 to which the gray scale distribution method or gray scale distribution apparatus of an embodiment of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 is used as a medium to provide communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 605 via the network 604 using the terminal devices 601, 602, 603 to receive or send messages, etc. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 601, 602, 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using terminal devices 601, 602, 603. The background management server may analyze and process the received data such as the article information query request, and feedback the processing result (e.g., the target push information, the article information—only an example) to the terminal device.
Note that, the gray scale distribution method provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the gray scale distribution device is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, there is illustrated a schematic diagram of a computer system 700 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, ROM 702, and RAM703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 701.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a receiving module and a calling module, where the names of the modules do not constitute a limitation on the module itself in some cases.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, implement the method of: receiving and analyzing a service request to obtain a service field and corresponding service parameters thereof; intercepting method call of a shunting assembly, and judging whether shunting configuration information of the shunting assembly is locally stored or not; if yes, matching the component realization class name of the target version from the distribution configuration information according to the service field and the corresponding service parameters thereof, so as to call a method corresponding to the component realization class name of the target version.
According to the technical scheme of the embodiment of the invention, the method call of the shunt assembly is intercepted, whether the shunt configuration information of the shunt assembly is locally stored is judged, if yes, the assembly realization class name of the target version is matched, and the technical means of the corresponding method is called, so that the technical problems of large development workload, poor maintainability or more occupied hardware resources in the prior art are solved. According to the embodiment of the invention, the distribution configuration information of each distribution assembly is uniformly configured through the distribution configuration center, so that the distribution configuration information is easier to maintain; and code control shunt logic is not needed, development workload is reduced, independent gray level grouping is not needed, server resources are saved, independent branch codes are not needed to be established, and branch code management is simplified. Therefore, the embodiment of the invention can flexibly and efficiently complete the gray level release of the system without increasing hardware consumption, introducing extra code branches and increasing system switches, simplifies the difficulty of shunt realization and reduces the workload of shunt realization.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (9)
1. A gray scale distribution method, which is applied to an application container, comprising:
starting an application container, and finding out a shunting component added with multi-version notes in application codes;
registering each shunt assembly to a shunt configuration center according to a shunt configuration address of the shunt configuration center; wherein the registration information of the shunt component includes: the address of the application container, the component realization class names of all versions corresponding to the shunt component and the method names thereof;
receiving and analyzing a service request to obtain a service field and corresponding service parameters thereof;
intercepting method call of a shunting assembly, and judging whether shunting configuration information of the shunting assembly is locally stored or not; the distribution configuration information comprises the corresponding relation between each distribution condition and each version of component realization class name;
If yes, matching a component realization class name of a target version from the distribution configuration information according to the service field and the corresponding service parameters thereof, so as to call a method corresponding to the component realization class name of the target version;
according to the service field and the corresponding service parameters, matching the component realization class name of the target version from the distribution configuration information, including:
determining a target distribution condition according to each service field and the corresponding service parameter;
and matching the component realization class name of the corresponding target version from the shunt configuration information according to the target shunt condition.
2. The method of claim 1, wherein the registration information of the offload component further comprises a callback port;
after registering each of the shunt components to the shunt configuration center according to the shunt configuration address of the shunt configuration center, the method further comprises:
and monitoring whether the distribution configuration information of the distribution component is updated or not through a callback port.
3. The method of claim 2, wherein monitoring, via a callback port, whether the offload configuration information of the offload component is updated, further comprises:
Receiving a configuration update message sent by the shunt configuration center;
pulling the corresponding shunt configuration information of each shunt component from the shunt configuration center and storing the shunt configuration information in a local place;
wherein the split condition includes a combination of parameter information of at least one service field.
4. The method of claim 2, wherein after registering each of the offload components with the offload configuration center according to an offload configuration address of the offload configuration center, further comprising:
and regularly refreshing the registration information of each shunt component in the shunt configuration center through a timing task.
5. The method as recited in claim 1, further comprising: if not, calling a method before intercepting the shunt component.
6. The method as recited in claim 1, further comprising:
after the method call is finished, recording a call log; the call log comprises called components, versions of the called components and corresponding call results.
7. A gradation issuing apparatus provided in an application container, comprising:
the registration module is used for starting the application container and finding out a shunting assembly added with multi-version notes in the application code; registering each shunt assembly to a shunt configuration center according to a shunt configuration address of the shunt configuration center; wherein the registration information of the shunt component includes: the address of the application container, the component realization class names of all versions corresponding to the shunt component and the method names thereof;
The receiving module is used for receiving and analyzing the service request to obtain a service field and corresponding service parameters thereof;
the calling module is used for intercepting the method call of the shunting assembly and judging whether shunting configuration information of the shunting assembly is locally stored or not; if yes, matching a component realization class name of a target version from the distribution configuration information according to the service field and the corresponding service parameters thereof, so as to call a method corresponding to the component realization class name of the target version; the distribution configuration information comprises the corresponding relation between each distribution condition and each version of component realization class name;
the calling module is further used for:
determining a target distribution condition according to each service field and the corresponding service parameter;
and matching the component realization class name of the corresponding target version from the shunt configuration information according to the target shunt condition.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more processors implement the method of any of claims 1-6 when the one or more programs are executed by the one or more processors.
9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010265347.4A CN113495747B (en) | 2020-04-07 | 2020-04-07 | Gray scale release method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010265347.4A CN113495747B (en) | 2020-04-07 | 2020-04-07 | Gray scale release method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113495747A CN113495747A (en) | 2021-10-12 |
CN113495747B true CN113495747B (en) | 2023-09-26 |
Family
ID=77995601
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010265347.4A Active CN113495747B (en) | 2020-04-07 | 2020-04-07 | Gray scale release method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113495747B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103095743A (en) * | 2011-10-28 | 2013-05-08 | 阿里巴巴集团控股有限公司 | Handling method and system of grey release |
WO2016179958A1 (en) * | 2015-05-12 | 2016-11-17 | 百度在线网络技术(北京)有限公司 | Method, device and system for performing grey-releasing on mobile application |
CN108595337A (en) * | 2018-05-07 | 2018-09-28 | 杭州有赞科技有限公司 | A kind of operation method and system of Jar packets |
WO2019029457A1 (en) * | 2017-08-07 | 2019-02-14 | 阿里巴巴集团控股有限公司 | Method and apparatus for updating application program on client, and electronic device |
WO2019047821A1 (en) * | 2017-09-07 | 2019-03-14 | 华为技术有限公司 | Service routing method, device and storage medium |
CN109857409A (en) * | 2019-01-16 | 2019-06-07 | 深圳壹账通智能科技有限公司 | Data processing method, device and computer equipment based on micro services gateway |
CN109995713A (en) * | 2017-12-30 | 2019-07-09 | 华为技术有限公司 | Service processing method and relevant device in a kind of micro services frame |
CN110245014A (en) * | 2018-03-09 | 2019-09-17 | 北京京东尚科信息技术有限公司 | Data processing method and device |
CN110830374A (en) * | 2018-08-07 | 2020-02-21 | 北京京东尚科信息技术有限公司 | Method and device for gray level release based on SDK |
CN110825425A (en) * | 2018-08-09 | 2020-02-21 | 北京京东尚科信息技术有限公司 | Configuration data management method and device, electronic equipment and storage medium |
-
2020
- 2020-04-07 CN CN202010265347.4A patent/CN113495747B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103095743A (en) * | 2011-10-28 | 2013-05-08 | 阿里巴巴集团控股有限公司 | Handling method and system of grey release |
WO2016179958A1 (en) * | 2015-05-12 | 2016-11-17 | 百度在线网络技术(北京)有限公司 | Method, device and system for performing grey-releasing on mobile application |
WO2019029457A1 (en) * | 2017-08-07 | 2019-02-14 | 阿里巴巴集团控股有限公司 | Method and apparatus for updating application program on client, and electronic device |
WO2019047821A1 (en) * | 2017-09-07 | 2019-03-14 | 华为技术有限公司 | Service routing method, device and storage medium |
CN109995713A (en) * | 2017-12-30 | 2019-07-09 | 华为技术有限公司 | Service processing method and relevant device in a kind of micro services frame |
CN110245014A (en) * | 2018-03-09 | 2019-09-17 | 北京京东尚科信息技术有限公司 | Data processing method and device |
CN108595337A (en) * | 2018-05-07 | 2018-09-28 | 杭州有赞科技有限公司 | A kind of operation method and system of Jar packets |
CN110830374A (en) * | 2018-08-07 | 2020-02-21 | 北京京东尚科信息技术有限公司 | Method and device for gray level release based on SDK |
CN110825425A (en) * | 2018-08-09 | 2020-02-21 | 北京京东尚科信息技术有限公司 | Configuration data management method and device, electronic equipment and storage medium |
CN109857409A (en) * | 2019-01-16 | 2019-06-07 | 深圳壹账通智能科技有限公司 | Data processing method, device and computer equipment based on micro services gateway |
Non-Patent Citations (1)
Title |
---|
面向工作流的Gitlab服务化设计;张宇光;王俊杰;计算机系统应用(09);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113495747A (en) | 2021-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110324169B (en) | Interface management method and device | |
CN110764769B (en) | Method and device for processing user request | |
CN111427701A (en) | Workflow engine system and business processing method | |
CN111666293A (en) | Database access method and device | |
CN110795315A (en) | Method and apparatus for monitoring services | |
CN112947919B (en) | Method and device for building business model and processing business request | |
CN111062682B (en) | Work order processing method and device | |
CN111414154A (en) | Method and device for front-end development, electronic equipment and storage medium | |
CN112306984A (en) | A data source routing method and device | |
CN113760722A (en) | Test system and test method | |
CN110083457A (en) | A kind of data capture method, device and data analysing method, device | |
CN113742235A (en) | A method and device for checking code | |
CN112579447A (en) | Browser testing method and device | |
CN113760969A (en) | Data query method and device based on elastic search | |
CN111382953A (en) | Dynamic process generation method and device | |
CN113448602A (en) | Version updating method and device | |
CN109981546B (en) | Method and device for acquiring remote call relation between application modules | |
CN113760481A (en) | Distributed timed task scheduling system and method | |
CN113127335A (en) | System testing method and device | |
CN113495747B (en) | Gray scale release method and device | |
CN113672671A (en) | Method and device for realizing data processing | |
US12353411B2 (en) | Database systems and client-side query transformation methods | |
CN113821519B (en) | Data processing method and domain drive design architecture | |
CN113110898A (en) | Transaction task execution method and device | |
US12301423B2 (en) | Service map conversion with preserved historical information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |