Disclosure of Invention
Aiming at the defects of gray level release in the prior art, the invention provides a gray level release method, which comprises the following steps:
sending an access request of a user to an application server for gray scale recognition and receiving a gray scale recognition result returned by the application server;
judging the current access request as a gray transaction request according to the gray identification result;
and determining that the current access request is a gray scale transaction request, and forwarding the current access request to a gray scale application server.
In the embodiment of the invention, the method comprises the following steps:
the application server generates a gray scale identification result according to a preset white list strategy and an access request of a user, and processes the access request according to the generated gray scale identification result to generate a service processing result message;
and receiving a message which comprises a gray level identification result and a service processing result and is returned by the application server.
In the embodiment of the present invention, the method further includes:
receiving a preset white list strategy;
and loading the white list strategy to a memory or a cache of an application server.
In the embodiment of the present invention, the white list policy includes: and preset transaction type information, client identification information and transaction version information.
In the embodiment of the present invention, the method further includes:
and if the current access request is determined to be a non-gray level transaction request, returning the service processing result message to the user.
Meanwhile, the invention also provides a gray level publishing device, which comprises:
the receiving and sending module is used for sending the received access request of the user to the application server for gray level identification;
the judging module is used for judging that the current access request is a gray level transaction request according to the gray level identification result;
and the flow guiding module is used for determining that the current access request is a gray level transaction request, and forwarding the current access request to the gray level application server.
In the embodiment of the invention, the application server generates a gray scale identification result according to a preset white list strategy and an access request of a user, and processes the access request according to the generated gray scale identification result to generate a service processing result message;
and the transceiver module receives a message which comprises a gray scale identification result and a service processing result and is returned by the application server.
In the embodiment of the present invention, the apparatus further includes:
the white list strategy setting module is used for receiving a preset white list strategy;
and the loading module is used for loading the white list strategy into a memory or a cache of the application server.
In the embodiment of the present invention, the white list policy includes: and preset transaction type information, client identification information and transaction version information.
In the embodiment of the invention, the non-gray level transaction request of the current access request is determined, and the traffic guiding module returns the service processing result message to the user.
Meanwhile, the invention also provides a gray scale release system, which comprises: a gateway server, an application server and a gray scale application server; wherein,
the gateway server sends the received access request of the user to the application server for gray level identification;
the application server generates a gray scale recognition result according to the access request of the user;
and the gateway server determines that the current access request is a gray scale transaction request according to the gray scale identification result, and forwards the current access request to a gray scale application server.
Meanwhile, the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the method when executing the computer program.
Meanwhile, the invention also provides a computer readable storage medium, and a computer program for executing the method is stored in the computer readable storage medium.
According to the gray scale release scheme provided by the invention, the access request of the user is sent to the application server for gray scale identification, the current access request is determined to be a gray scale transaction request, and then the current access request is forwarded to the gray scale application server. The method is transparent and insensitive to users, and the request initiated from the client side does not distinguish gray scales from non-gray scales. The client can obtain the response result by only initiating the request once. The scheme is suitable for a C/S architecture system and a B/S architecture system. The method has the advantages that the adaptability is strong, the gray strategy can be flexibly defined through the configuration of different gray dimensions of the gray white list, the gray strategy is fine and accurate, and the method is favorable for the follow-up analysis of user behaviors and the improvement of product operation.
In order to make the aforementioned and other objects, features and advantages of the invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Description of terms:
canary release, also known as gray release, refers to a release mode that can make smooth transition between black and white. On which an a/B test may be performed, i.e. a part of the users continue to use product property a, a part of the users start to use product property B, if the users have no objection to B, the scope is gradually enlarged, and all the users are migrated to B. The gray release can ensure the stability of the whole system, and the problems can be found and adjusted when the gray of a room is processed, so as to ensure the influence degree of the gray.
The period of time from the start to the end of gradation issuance is referred to as a gradation period.
And load balancing, namely loading the client request quantity to each server through F5 by using the load differentiation request quantity, so as to achieve the purposes of reducing the server pressure and increasing the overall throughput of the system. The load is divided into software load and hardware load, and the software load usually uses nginx tool to realize load balance. And the F5 load balancer is a hardware network performance optimization device.
The drainage method is simple to implement, low in implementation cost and transparent and non-inductive to users, and overcomes the defect of the conventional gray level release scheme in requesting drainage. As shown in fig. 1, a flowchart of a gray scale publishing method provided by the present invention is provided, where the method includes:
step S101, sending an access request of a user to an application server for gray scale recognition and receiving a gray scale recognition result returned by the application server;
step S102, judging the current access request as a gray transaction request according to the gray identification result;
step S103, determining that the current access request is a gray scale transaction request, and forwarding the current access request to a gray scale application server.
The gray scale issuing method provided by the invention has the advantages that the gray scale identification is carried out by the application server, the transparency and the insensitivity of the gray scale issuing to users are realized, the current access request is determined to be the gray scale transaction request, and the access request is forwarded to the gray scale application server, so that the defect of the request drainage in the gray scale issuing scheme in the prior art is overcome, and the drainage method which is simple to realize, low in implementation cost and transparent and insensitivity to the users is provided.
In the embodiment of the present invention, sending an access request of a user to an application server for gray scale recognition and receiving a gray scale recognition result returned by the application server specifically includes:
the application server generates a gray scale identification result according to a preset white list strategy and an access request of a user, and processes the access request according to the generated gray scale identification result to generate a service processing result message;
and receiving a message which comprises a gray level identification result and a service processing result and is returned by the application server.
In the embodiment of the present invention, the method further includes:
receiving a preset white list strategy;
and loading the white list strategy to a memory or a cache of an application server.
Specifically, in the embodiment of the present invention, the application server loads the gray white list policy to the memory or the cache in advance to improve the query efficiency, and queries the gray white list policy table according to the information such as the type of the transaction, the client identifier, and the transaction version in the sent access request of the user, so as to determine whether the user hits the white list.
In the embodiment of the present invention, the white list policy includes: and preset transaction type information, client identification information and transaction version information.
If hit, it indicates that the request should be processed by the grayscale application server, and returns the judgment results of "1-hit" and "0-miss".
If the gray judgment result is '0-miss', the application server directly performs the service logic processing of the subsequent request, and returns the service after the service transaction is completed. Namely, the current access request is determined to be a non-gray level transaction request, and the service processing result message is returned to the user. Namely, the result returned by the application server also includes the actual service processing result message corresponding to the current application access request.
The returned results of the gray scale judgment of the conventional application server comprise:
1. grayscale judgment result flag, 0-miss, 1-hit;
2. and (5) processing a result message by the actual service. If the gray level mark is '1-hit', the service processing result message is empty; if the gray scale flag is "0-miss", the actual service processing result message is not empty.
The gray level publishing method overcomes the defect of requesting drainage in the existing gray level publishing scheme, and is simple to implement, low in implementation cost and transparent and non-inductive to users.
In the prior art, a large-scale internet background system for customer service is generally based on a distributed architecture deployment server, that is, a Cluster (Cluster) is formed by a plurality of application servers deployed with the same application program and provides service to the outside at the same time, traffic forwarding is completed between application server clusters receiving and sending http requests from the internet through a load balancing device (F5) or a load balancing system, and physical gray scale distribution is completed based on load balancing hardware (F5) or the load balancing system. Currently, there are two ways for forwarding gray-scale traffic:
(1) the request from the user to access the system is itself accompanied by a gray scale identification as shown in figure 2. The gray level traffic forwarding mode is to make the user login request carry the gray level identification, generally, client software is upgraded, logic of gray level processing is included in the software, when a part of clients of users send http requests, specific gray level identification is added in cookies of http messages, and Load balancing hardware equipment (F5) or a Soft Load balancing system (SLB-Soft Load Balance) identifies the requests and forwards the requests to a new gray level environment. And a group of cache servers are arranged between the new environment and the old environment and used for storing and synchronizing http sessions of clients so as to prevent the session loss problem after gray scale drainage switching is performed during user access.
The request for the user to access the system is provided with the gray scale identification, which requires that the gray scale processing logic is embedded in the client. This situation requires that: the client is provided by the service provider so that the service provider can embed the gray scale logic. It is not possible to implement a system in which the client is not controlled by the server. For example, a direct connection system between a bank and an enterprise, an enterprise ERP system is a third-party ERP system which is developed or purchased by the enterprise, and does not include a gray processing logic.
(2) The user's request to access the system is not accompanied by a gray scale identification, as shown in fig. 3. If the request message of the user does not have the gray scale identifier, the request message is sent to an application server in the old environment to process the transaction after passing through a load balancing device F5 or an SLB system, the application server judges that if the user or the transaction request is in a gray scale range, the request message is marked with the gray scale identifier and is forwarded back to the client through redirection, the request containing the gray scale identifier is initiated again by a browser of the client, and the second request is identified as the gray scale transaction request after passing through the load balancing device or the system and is sent to a new environment to be processed.
For the second scheme, the request of the user to access the system does not have the gray scale identifier:
the client needs to send 2 requests, the first time is to send the request without the gray scale identifier, and the second time is to send the request with the gray scale identifier. The 2 network requests exacerbate the slow transaction processing condition caused by network delay, and the user experience is reduced.
The invention also provides a gray scale publishing system, comprising: a gateway server, an application server and a gray scale application server; wherein,
the gateway server sends the received access request of the user to the application server for gray level identification;
the application server generates a gray scale recognition result according to the access request of the user;
and the gateway server determines that the current access request is a gray scale transaction request according to the gray scale identification result, and forwards the current access request to a gray scale application server.
The gray scale release system provided by the embodiment of the invention is suitable for a C/S (client/server) architecture system similar to the butt joint of an enterprise ERP (enterprise resource planning) system and a bank, namely a client-server architecture, wherein the client is developed and maintained by an enterprise, and the bank side only provides a butt joint http interface for the enterprise to use.
As shown in fig. 4, a system diagram of gray scale publishing provided by the embodiment of the present invention is shown.
Specifically, a user initiates an http request called by an interface through a client system, the client encrypts and signs the http request by using an encryption algorithm and a signature algorithm, the encrypted and signed http request reaches a bank through the internet or a special network service line specially applied and opened by an enterprise, a front gateway server deployed in a network isolation area (namely a dematrized Zone-DMZ area) on the bank side receives the http request, and after the signature verification and decryption of the request are completed, a transaction message is forwarded to a product application server deployed in the internet area of the bank to complete transaction processing.
In the gray scale publishing system provided by the embodiment of the invention, the application server and the gray scale application server are respectively deployed for the distributed cluster, common load balancing drainage is completed by the F5 device before the cluster, and in the embodiment, the F5 device generally completes the forwarding of the request according to a polling algorithm, a random algorithm or an LRU algorithm.
The gray level drainage scheme which is insensitive to users in the embodiment of the invention mainly comprises the following processing flows:
1. the preposed gateway server is used as a proxy server for load balancing request forwarding;
2. the application server provides the judgment logic of the gray strategy.
The overall transaction liquidation steps are as follows:
1. user transaction http request is sent to the front gateway server of the bank through the internet
2. The front-end gateway server completes the verification of the transaction, checks the signature, and then calls a conventional application server gray scale strategy judgment component to judge whether the transaction belongs to the gray scale transaction request.
3. The conventional application server loads the gray white list strategy into a memory or a cache in advance to improve query efficiency, queries a gray white list strategy table according to information such as transaction types, client identifications, transaction versions and the like in an http request sent by a gateway server, judges whether the white list is hit, if the white list is hit, indicates that the request is processed by the gray application server, and returns judgment results of '1-hit' and '0-miss' to the front-end gateway server.
If the gray judgment result is '0-miss', the application server directly performs the service logic processing of the subsequent request, and returns the service after the service transaction is completed.
The returned result of the gray scale judgment of the conventional application server comprises 2 parts of information: a gray judgment result mark (0-miss, 1-hit) and an actual service processing result message. If the gray level mark is '1-hit', the service processing result message is empty; if the gray scale flag is "0-miss", the actual service processing result message is not empty.
4. The grey scale drainage scheduling component of the gateway server obtains the processing result returned from the application server. Firstly, judging the gray scale identification, if the gray scale identification is '1-hit', a 'gray scale drainage dispatching component' of the gateway server forwards the request to a gray scale application server for processing. And if the gray judgment result is '0-miss', jumping to the step 6.
5. After receiving the transaction request sent by the gateway server, the gray application server directly sends the transaction request to the service processing component to complete the transaction processing and return the result.
6. The gateway server obtains the result returned from the application server, extracts the actual service processing result message, and returns the message to the user after encryption and signature addition.
In the embodiment of the invention, the white list of the gray strategy is a configuration table stored in a database, and the table mainly comprises the following table fields: transaction type, user ID, transaction version, area number, website number, gray level validation flag, record validation flag, and update date.
In this embodiment, the update of the white list of the application server:
the white list table records are pre-validated at the design stage of a version of the system optimization upgrade, submitted in the form of a data script (containing insert, update, etc. dml statements), and executed during the commissioning deployment stage to update the white list table records. Meanwhile, a white list emergency backspace script is provided for emergency use of operation and maintenance personnel when the system is in problem and needs emergency backspace during gray scale.
If the white list strategy needs to be modified during the gray scale execution period, such as expanding the user range, the transaction range and the like, the script is taken out again in a data change script mode to update the white list table.
In the embodiment of the invention, the white list table in the application server is used, and in order to accelerate the query efficiency of the white list table, the white list records need to be pre-loaded to the cache when the system is started. The method is to define a background task in the system, execute the background task at the time of starting the system, and execute the background task regularly (for example, execute the background task once in 30 minutes) during the running period of the subsequent system. The task content is that two mapping tables are cached and maintained in a server, one mapping table is constructed by taking a transaction type, an area number and a network point number as keys and taking a gray level effective marker bit value; one is constructed by taking the transaction type + user ID + transaction version as a key and taking a gray level validation flag value.
The former mapping table has a coarse granularity, a white list can be set according to the dimensionality of a certain region, such as province, city and network site, and if the white list of the certain region is opened and the requesting client belongs to the region, the white list is considered to be hit.
The latter mapping table has a fine granularity, can be specific to a specific user, mainly aims at large group company customers, and can be independently set if the transaction amount is huge.
Due to the system hot loading of the white list of the application server, the software system cannot be stopped or restarted at will during the running process, which greatly influences the stable running of the production. Therefore, after the white list table data is updated, the white list table data needs to be loaded to the cache when the system runs through the timing task. If the white list changes frequently, the timing task interval can be shortened. If the overhead of updating the white list (mainly database access overhead) is to be reduced, the white list may be stored to a read-only database or a backup repository.
The gray level release system provided by the embodiment of the invention has the following advantages that:
1. the gray scale release scheme is transparent and insensitive to a user (namely a service calling party), and the request initiated from the client side is not distinguished from the non-gray scale.
2. According to the scheme, the client can obtain a response result only by initiating a request once.
3. The updating of the gray strategy can take effect in near real time, which is beneficial to adjusting the gray strategy at any time during the gray period.
4. The scheme is suitable for a C/S architecture system and a B/S architecture system.
5. The scheme has strong adaptability, can flexibly define the gray strategy through the configuration of different gray dimensions of the gray white list, has fine and accurate gray strategy, and is favorable for the subsequent analysis of user behaviors and the promotion of product operation.
Meanwhile, the present invention also provides a gray scale issuing apparatus, as shown in fig. 5, the gray scale issuing apparatus provided by the present invention includes:
thetransceiver module 501 is configured to send a received access request of a user to an application server for grayscale identification;
a judgingmodule 502, configured to judge, according to the grayscale recognition result, that the current access request is a grayscale transaction request;
and theflow guiding module 503 is configured to determine that the current access request is a gray level transaction request, and forward the current access request to the gray level application server.
In the embodiment of the invention, the application server generates a gray scale identification result according to a preset white list strategy and an access request of a user, and processes the access request according to the generated gray scale identification result to generate a service processing result message;
and the transceiver module receives a message which comprises a gray scale identification result and a service processing result and is returned by the application server.
In the embodiment of the present invention, the apparatus further includes:
the white list strategy setting module is used for receiving a preset white list strategy;
and the loading module is used for loading the white list strategy into a memory or a cache of the application server.
In the embodiment of the present invention, the white list policy includes: and preset transaction type information, client identification information and transaction version information.
In the embodiment of the invention, the non-gray level transaction request of the current access request is determined, and the traffic guiding module returns the service processing result message to the user.
For those skilled in the art, the implementation of the gray scale releasing apparatus provided by the present invention can be clearly understood through the foregoing description of the embodiments, and details are not repeated herein.
It should be noted that the disclosed gray scale publishing method and apparatus can be used for gray scale publishing of financial products in the financial field, and can also be used for gray scale publishing of products in any field except the financial field.
The present embodiment also provides an electronic device, which may be a desktop computer, a tablet computer, a mobile terminal, and the like, but is not limited thereto. In this embodiment, the electronic device may refer to the embodiments of the method and the apparatus, and the contents thereof are incorporated herein, and repeated descriptions are omitted.
Fig. 6 is a schematic block diagram of a system configuration of anelectronic apparatus 600 according to an embodiment of the present invention. As shown in fig. 6, theelectronic device 600 may include acentral processor 100 and amemory 140; thememory 140 is coupled to thecentral processor 100. Notably, this diagram is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the gray scale issue function may be integrated into thecentral processor 100. Thecentral processor 100 may be configured to control as follows:
sending an access request of a user to an application server for gray scale recognition and receiving a gray scale recognition result returned by the application server;
judging the current access request as a gray transaction request according to the gray identification result;
and determining that the current access request is a gray scale transaction request, and forwarding the current access request to a gray scale application server.
In another embodiment, the gray scale issuing apparatus may be configured separately from thecentral processing unit 100, for example, the gray scale issuing apparatus may be configured as a chip connected to thecentral processing unit 100, and the gray scale issuing function is realized by the control of the central processing unit.
As shown in fig. 6, theelectronic device 600 may further include:communication module 110,input unit 120,audio processing unit 130,display 160,power supply 170. It is noted that theelectronic device 600 does not necessarily include all of the components shown in FIG. 6; furthermore, theelectronic device 600 may also comprise components not shown in fig. 6, which may be referred to in the prior art.
As shown in fig. 6, thecentral processor 100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, thecentral processor 100 receiving input and controlling the operation of the various components of theelectronic device 600.
Thememory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And thecentral processing unit 100 may execute the program stored in thememory 140 to realize information storage or processing, etc.
Theinput unit 120 provides input to thecpu 100. Theinput unit 120 is, for example, a key or a touch input device. Thepower supply 170 is used to provide power to theelectronic device 600. Thedisplay 160 is used to display an object to be displayed, such as an image or a character. The display may be, for example, an LCD display, but is not limited thereto.
Thememory 140 may be a solid state memory such as Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. Thememory 140 may also be some other type of device.Memory 140 includes buffer memory 141 (sometimes referred to as a buffer). Thememory 140 may include an application/function storage section 142, and the application/function storage section 142 is used to store application programs and function programs or a flow for executing the operation of theelectronic device 600 by thecentral processing unit 100.
Thememory 140 may also include adata store 143, thedata store 143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. Thedriver storage portion 144 of thememory 140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging application, address book application, etc.).
Thecommunication module 110 is a transmitter/receiver 110 that transmits and receives signals via anantenna 111. The communication module (transmitter/receiver) 110 is coupled to thecentral processor 100 to provide an input signal and receive an output signal, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality ofcommunication modules 110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 110 is also coupled to aspeaker 131 and amicrophone 132 via anaudio processor 130 to provide audio output via thespeaker 131 and receive audio input from themicrophone 132 to implement general telecommunications functions.Audio processor 130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, anaudio processor 130 is also coupled to thecentral processor 100, so that recording on the local can be enabled through amicrophone 132, and so that sound stored on the local can be played through aspeaker 131.
Embodiments of the present invention also provide a computer-readable program, where when the program is executed in an electronic device, the program causes a computer to execute the grayscale issuing method in the electronic device as described in the above embodiments.
An embodiment of the present invention further provides a storage medium storing a computer-readable program, where the computer-readable program enables a computer to execute the gray scale distribution described in the above embodiment in an electronic device.
The preferred embodiments of the present invention have been described above with reference to the accompanying drawings. The many features and advantages of the embodiments are apparent from the detailed specification, and thus, it is intended by the appended claims to cover all such features and advantages of the embodiments that fall within the true spirit and scope thereof. Further, since numerous modifications and changes will readily occur to those skilled in the art, it is not desired to limit the embodiments of the invention to the exact construction and operation illustrated and described, and accordingly, all suitable modifications and equivalents may be resorted to, falling within the scope thereof.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.