CN114489770A - Gray scale distribution method and device, computer equipment and storage medium - Google Patents

Gray scale distribution method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114489770A
CN114489770A CN202210092254.5A CN202210092254A CN114489770A CN 114489770 A CN114489770 A CN 114489770A CN 202210092254 A CN202210092254 A CN 202210092254A CN 114489770 A CN114489770 A CN 114489770A
Authority
CN
China
Prior art keywords
data
gray
message queue
service data
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210092254.5A
Other languages
Chinese (zh)
Inventor
孟少川
雷赛龄
杨小可
李天浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210092254.5A priority Critical patent/CN114489770A/en
Publication of CN114489770A publication Critical patent/CN114489770A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application relates to a gray scale distribution method, apparatus, computer device, storage medium, and computer program product, which may be used in the financial field or other fields. The method comprises the following steps: obtaining message queue data and a message queue data address; extracting gray level control data in the message queue data to obtain a gray level state identifier; extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring processing rules of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address; and performing gray scale release according to the processing rules of the new system and the old system on the service data. According to the method, the service data are subjected to data identification to obtain the system identification corresponding to the service data, so that different data processing rules are executed on different service data by a new system and an old system in the gray level publishing process, and the controllability of gray level publishing can be improved.

Description

Gray scale distribution method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for gray scale distribution, a computer device, a storage medium, and a computer program product.
Background
Along with the development of internet and computer technology, financial technology systems go deep into each field of people's production and life, and the market has proposed higher requirement to financial technology system stability, and grey level issue technique has become the stable important guarantee of financial technology systems.
When a new version of a system is released, a part of a new system B is additionally started on the basis that an old system A keeps running, and the new system and the old system process input data together; if the new system B does not have problems in operation, the old system A is gradually stopped, and the new system B is correspondingly added and started until all versions are released. However, in this gray scale distribution method, when the new system B starts to operate, gray scale distribution starts until the old system a completely stops, gray scale distribution stops, and the gray scale distribution process cannot be controlled to start or end at a specified time or to control where the gray scale distribution starts and ends in a message queue, which has a problem of poor controllability of gray scale distribution.
Disclosure of Invention
Based on this, it is necessary to provide a gray scale distribution method, an apparatus, a computer device, a computer readable storage medium, and a computer program product capable of improving controllability of gray scale distribution, in view of a problem that the conventional gray scale distribution method is poor in controllability.
In a first aspect, the present application provides a gray scale publishing method. The method comprises the following steps:
obtaining message queue data and a message queue data address;
extracting gray level control data in the message queue data to obtain a gray level state identifier;
extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring processing rules of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address;
and performing gray scale release according to the processing rules of the new system and the old system on the service data.
In one embodiment, extracting the gray-scale control data from the message queue data, and obtaining the gray-scale state identifier comprises:
extracting gray control data in the message queue data;
if the gray control data is gray starting data, acquiring a gray starting state identifier, and writing the gray starting state identifier and the message queue data address corresponding to the gray starting data into a key (key) and a value (value) of the database key value pair respectively.
In one embodiment, extracting the gray-scale control data from the message queue data, and obtaining the gray-scale state identifier further includes:
and if the gray control data is gray end data, acquiring a gray end state identifier and deleting the existing database key value pair.
In one embodiment, the extracting service data in the message queue data, obtaining a system identifier corresponding to the service data through data identification, and obtaining a processing rule of the new system and the old system for the service data according to the system identifier, the gray state identifier and the message queue data address includes:
extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and reading a database key value pair;
if the key of the database key value pair does not correspond to the gray scale starting state identifier or the key of the database key value pair is empty, the old system processes the service data;
and if the key of the database key value pair corresponds to the gray scale starting state identifier, acquiring a first processing rule of the new system and the old system for the service data according to the value of the database key value pair, the message queue data address and the system identifier.
In one embodiment, obtaining the first processing rule of the new system and the old system for the business data according to the value of the database key-value pair, the message queue data address and the system identifier includes:
if the data address represented by the value of the database key value pair is larger than the message queue data address corresponding to the service data, the old system processes the service data;
and if the data address represented by the value of the database key value pair is smaller than the message queue data address corresponding to the service data, acquiring a second processing rule of the new system and the old system on the service data according to the system identification.
In one embodiment, obtaining the second processing rule for the service data by the new system and the old system according to the system identifier comprises:
if the system identifier is an old system identifier, the old system processes the service data;
and if the system identifier is the new system identifier, the new system processes the service data.
In a second aspect, the present application further provides a gray scale issuing apparatus. The device comprises:
the data acquisition module is used for acquiring message queue data and a message queue data address;
the gray level state identification acquisition module is used for extracting gray level control data in the message queue data to acquire a gray level state identification;
the processing rule obtaining module is used for extracting the service data in the message queue data, obtaining a system identifier corresponding to the service data through data identification, and obtaining the processing rules of the new system and the old system for the service data according to the system identifier, the gray state identifier and the message queue data address;
and the gray release module is used for performing gray release according to the processing rules of the new system and the old system on the service data.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
obtaining message queue data and a message queue data address; extracting gray level control data in the message queue data to obtain a gray level state identifier; extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring processing rules of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address; and performing gray scale release according to the processing rules of the new system and the old system on the service data.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
obtaining message queue data and a message queue data address; extracting gray level control data in the message queue data to obtain a gray level state identifier; extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring processing rules of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address; and performing gray scale release according to the processing rules of the new system and the old system on the service data.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
obtaining message queue data and a message queue data address; extracting gray level control data in the message queue data to obtain a gray level state identifier; extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring processing rules of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address; and performing gray scale release according to the processing rules of the new system and the old system on the service data.
The gray level publishing method, the gray level publishing device, the computer equipment, the storage medium and the computer program product extract gray level control data in the message queue data and gray level state identification by obtaining the message queue data and the message queue data address, extract business data in the message queue data, obtain system identification corresponding to the business data through data identification, obtain the processing rules of the new system and the old system on the business data according to the system identification, the gray level state identification and the message queue data address, and publish the gray level according to the processing rules of the new system and the old system on the business data. According to the scheme of the embodiment, the service data are subjected to data identification to obtain the system identification corresponding to the service data, so that different data processing rules can be executed on different service data by a new system and an old system in the gray scale release process, and the controllability of gray scale release is improved; based on the first-in first-out characteristic of the message queue, the gray control data and the service data are written into the message queue, the control of the starting time point and the ending time point of gray release can be realized, the gray release is carried out according to the gray state identification and the data address of the message queue, the control of the starting position and the ending position of the gray release at the specific position of the message queue can be realized, and the controllability of the gray release is further improved.
Drawings
FIG. 1 is a diagram of an exemplary embodiment of a gray scale publishing process;
FIG. 2 is a flow chart illustrating a gray scale publishing process in one embodiment;
FIG. 3 is a flow chart illustrating a gray scale publishing step in one embodiment;
FIG. 4 is a schematic diagram illustrating a sub-flow of S660 according to an embodiment;
FIG. 5 is a schematic sub-flow chart of S664 in one embodiment;
FIG. 6 is a flowchart illustrating a gray scale publishing method according to another embodiment;
FIG. 7 is a flowchart illustrating a gray scale releasing step in another embodiment;
fig. 8 is a block diagram showing the configuration of a gradation issuance apparatus in one embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The gray scale publishing method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. The terminal 102 obtains message queue data and a message queue data address; extracting gray level control data in the message queue data to obtain a gray level state identifier; extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring processing rules of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address; and performing gray scale release according to the processing rules of the new system and the old system on the service data. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
In one embodiment, as shown in fig. 2, a gray scale publishing method is provided, which is described by taking the method as an example applied to the terminal 102 in fig. 1, and includes the following steps:
s200, obtaining message queue data and message queue data addresses.
The message queue is a container for storing messages in the transmission process of the messages, is an important component in a distributed system, mainly solves the problems of application coupling, asynchronous messages, traffic cut and the like, and realizes a high-performance, high-availability, scalable and final consistency architecture. Kafka is an open source stream processing platform developed by the Apache software foundation, and is a high-throughput distributed publish-subscribe message system, in practical application, Kafka can be used for message queue, stream processing, log aggregation and the like, a very flexible publish-subscribe mode is adopted, both a server side and a client side can be flexibly expanded in real time, and the position of the client side for reading the message queue is accurately controlled through an offset mechanism. Preferably, the message queue used in the present application may be Kafka, and it should be noted that the type of the message queue used in the present application is not particularly limited. The message is sent to the message queue and recorded in the message queue according to the sequence of the receiving time, the obtained message queue data can be the text data of the message or the type of the message, and the message queue data address is the address of the message recorded in the message queue.
Specifically, message queue data and a message queue data address are obtained.
S400, extracting the gray level control data in the message queue data to obtain a gray level state identifier.
The gray release is a system release mode capable of smoothly transiting between black and white, in the version release process, parallel operation of an old system and a new system is kept, if the new system does not have problems in operation, the old system is gradually reduced, the new system is added until all the version releases are completed, the gray release can ensure the stability of the whole system, and the problems can be found and adjusted in the initial gray to ensure the influence degree. The gray control data is special data which is written into the message queue by a gray release control program and is added with a gray starting field or a gray ending field, the gray control data in the message queue data is extracted, and a gray state identifier is obtained and used for representing a gray starting state or a gray ending state.
Specifically, the gray scale control data in the message queue data is extracted to obtain the gray scale state identification.
S600, extracting service data in the message queue data, obtaining a system identifier corresponding to the service data through data identification, and obtaining a processing rule of the new system and the old system for the service data according to the system identifier, the gray state identifier and the message queue data address.
The new system is a target system for gray scale release, the old system is a source system for gray scale release, the new system and the old system are kept to run in parallel in the gray scale release process, the old system is gradually reduced, the new system is additionally started until the release of the new system is completed, the service data is data running in the old system, the new system is gradually switched to run along with the start of gray scale release according to a certain processing rule, the normal running of the service data in the new system is realized, the actual processing processes of the two systems on the data are not necessarily the same, but the two systems have the same status in the whole structure, are parallel, and share the data in the database. The service data is from the upstream of the system, and may be various deposit and withdrawal and transfer data generated in a banking system such as an ATM or a teller machine, and the specific source of the service data is not particularly limited in the present application. The data identification means a data identification module arranged between the message queue and the new system or between the message queue and the old system, and is used for carrying out data identification on message queue data in the message queue, the data identification module comprises a section of self-defined data identification rule, service data are written into the message queue at the upstream of the system, if the message queue data are gray control data, a gray starting field and a gray ending field in the gray control data are identified through data identification, and corresponding gray state identification is notified to the new system and the old system, if the message queue data are the service data, the system identification corresponding to the service data is obtained through the data identification, the system identification is used for representing whether the service data are processed by the new system or the old system, and further according to the system identification, the gray state identification and the message queue data address, and acquiring the processing rules of the new system and the old system on the business data.
Specifically, business data in the message queue data are extracted, a system identifier corresponding to the business data is obtained through data identification, and processing rules of the new system and the old system for the business data are obtained according to the system identifier, the gray state identifier and the message queue data address.
And S800, performing gray scale release according to the processing rules of the new system and the old system on the service data.
According to the processing rules of the new system and the old system for the business data, when the gray scale release is not started, the old system processes the business data, after the gray scale release is started, the old system and the new system respectively process the business data, and after the gray scale release is finished, the release of the new system is finished.
Specifically, the gray scale distribution is performed on the processing rule of the service data according to the new system and the old system.
In the gray level publishing method, gray level control data in the message queue data is extracted by obtaining the message queue data and the message queue data address, a gray level state identifier is obtained, service data in the message queue data is extracted, a system identifier corresponding to the service data is obtained through data identification, the processing rules of the new system and the old system for the service data are obtained according to the system identifier, the gray level state identifier and the message queue data address, and gray level publishing is carried out according to the processing rules of the new system and the old system for the service data. According to the scheme of the embodiment, the service data are subjected to data identification to obtain the system identification corresponding to the service data, so that different data processing rules can be executed on different service data by a new system and an old system in the gray scale release process, and the controllability of gray scale release is improved; based on the first-in first-out characteristic of the message queue, the gray control data and the service data are written into the message queue, the control of the starting time point and the ending time point of gray release can be realized, the gray release is carried out according to the gray state identification and the data address of the message queue, the control of the starting position and the ending position of the gray release at the specific position of the message queue can be realized, and the controllability of the gray release is further improved.
In one embodiment, extracting the gray-scale control data from the message queue data, and obtaining the gray-scale state identification comprises: extracting gray control data in the message queue data; and if the gray control data is gray starting data, acquiring a gray starting state identifier, and writing the gray starting state identifier and the message queue data address corresponding to the gray starting data into the key and the value of the database key value pair respectively.
In this embodiment, the gray control data includes gray start data, the gray control data in the message queue data is extracted, the gray control data is sent to the data identification module, the data identification module identifies the obtained gray control data, if the gray control data is the gray start data, the gray start state identifier is obtained, and the message queue data addresses corresponding to the gray start state identifier and the gray start data are written into the key and the value of the database key value pair respectively. The key value pair database stores data as a key value pair set, wherein keys (keys) are indexes of stored data, values (values) are data stored in corresponding keys, and the key value pairs are applied to the database and have the characteristics of high query speed and high support for concurrent query. In a publish-subscribe messaging system, a producer of a message is called a publisher, a consumer is called a subscriber, the consumer requests a message from a message queue, and can subscribe to one or more topics (topics) to consume the published message, the topics are message streams of a specific type, each Topic contains one or more partitions, when the Topic stores data, the data are randomly and uniformly distributed in each Partition, the partitions are physical concepts, each message is written into the message queue at an Offset (Offset), namely, a message queue data address corresponding to the message queue data, and the Offset is increased along with the writing of the message. Specifically, when the gray scale publishing control program writes gray scale control data into the message queue, a piece of gray scale control data is inserted into each Partition, that is, each Partition has its own gray scale state identifier, when a message is consumed by a plurality of consumers, the partitions accessed by each consumer are different, and the time of consuming the gray scale start state identifier is also different, so that the gray scale state control is not controlled by the granularity of a whole Topic, but is accurate to the Offset of each Partition. Respectively writing the information queue data addresses corresponding to the gray scale starting state identification and the gray scale starting data into key and value of the database key-value pair, and also writing the Offset corresponding to the Topic-Partition and the Topic-Partition corresponding to the gray scale starting state identification into key and value of the database key-value pair.
According to the scheme of the embodiment, the gray scale starting state identification and the message queue data address corresponding to the gray scale starting data are written in the key value pair of the database, so that the parallel execution and the state synchronization of the gray scales of the new system and the old system can be realized, the gray scale control data in the message queue data is extracted, the control of the gray scale release starting time point can be realized based on the first-in first-out characteristic of the message queue, the gray scale release is carried out according to the gray scale starting state identification, the control of the gray scale release starting at the specific position of the message queue can be realized, and the controllability of the gray scale release is improved.
In another embodiment, extracting the gray-scale control data from the message queue data, and obtaining the gray-scale state identifier further comprises: and if the gray control data is gray end data, acquiring a gray end state identifier and deleting the existing database key value pair.
In this embodiment, the grayscale control data further includes grayscale end data, the grayscale control data in the message queue data is extracted, the grayscale control data is sent to the data identification module, the data identification module identifies the obtained grayscale control data, and if the grayscale control data is grayscale end data, the grayscale end state identifier is obtained, and the existing database key value pair is deleted. Specifically, deleting the existing database key value pair, that is, deleting the gray scale start state identifier in the database key value pair key and deleting the message queue data address corresponding to the gray scale start data in the key value pair value.
According to the scheme of the embodiment, when the gray control data is the gray end data, the gray end state identification is obtained, the gray start state identification in the database key value pair and the message queue data address corresponding to the gray start data are deleted, parallel execution and state synchronization of the gray of the new system and the old system can be achieved, the gray control data in the message queue data are extracted, the control of the gray release end time point can be achieved based on the first-in first-out characteristic of the message queue, gray release is carried out according to the gray end state identification, the control of the gray release end at the specific position of the message queue can be achieved, and the controllability of the gray release is further improved.
In one embodiment, as shown in fig. 3, extracting service data in the message queue data, obtaining a system identifier corresponding to the service data through data identification, and obtaining a processing rule of the new system and the old system for the service data according to the system identifier, the gray state identifier, and the message queue data address includes:
s620, extracting the service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and reading a database key value pair;
s640, if the key of the database key value pair does not correspond to the gray scale starting state identifier or the key of the database key value pair is empty, the old system processes the service data;
and S660, if the key of the database key value pair corresponds to the gray scale starting state identifier, acquiring first processing rules of the new system and the old system for the service data according to the value of the database key value pair, the message queue data address and the system identifier.
In this embodiment, service data in the message queue data is extracted, the service data is identified by the data identification module, a system identifier corresponding to the service data is obtained, the new system and the old system receive the system identifier and the gray level control data sent by the data identification module, and read the database key value pair, if the key of the database key value pair does not correspond to the gray level start state identifier or the key of the database key value pair is empty, the old system processes the service data, that is, the gray level start data is not written into the message queue, the gray level issue is not started, and the service data is processed by the old system; and if the key of the database key value pair corresponds to the gray scale starting state identifier, acquiring a first processing rule of the new system and the old system for the service data according to the value of the database key value pair, the message queue data address and the system identifier.
According to the scheme of the embodiment, the business data in the message queue data are extracted, the system identification corresponding to the business data is obtained through data identification, the database key value pair is read, whether the key of the database key value pair corresponds to the gray scale starting state identification or not is judged, or whether the key of the database key value pair is empty or not is judged, so that the first processing rule of the new system and the old system for gray scale publishing on the business data is obtained, different data processing rules are executed on different business data based on the new system and the old system, and the controllability of gray scale publishing is improved.
In another embodiment, as shown in fig. 4, the obtaining the first processing rule of the new system and the old system for the business data according to the value of the database key-value pair, the message queue data address and the system identification includes:
s662, if the data address represented by the value of the database key value pair is larger than the message queue data address corresponding to the service data, the old system processes the service data;
and S664, if the data address represented by the value of the database key value pair is smaller than the message queue data address corresponding to the service data, obtaining a second processing rule of the new system and the old system on the service data according to the system identification.
In this embodiment, by determining the size of the data address represented by the value of the database key value pair and the message queue data address corresponding to the service data, if the data address represented by the value of the database key value pair is greater than the message queue data address corresponding to the service data, the old system processes the service data, that is, the gray scale starting data is written after the service data, when the service data is written, the gray scale publishing has not started yet, the service data is not included in the gray scale publishing range, and the old system processes the service data; and if the data address represented by the value of the database key value pair is smaller than the message queue data address corresponding to the service data, acquiring a second processing rule of the new system and the old system on the service data according to the system identification.
According to the scheme of the embodiment, the second processing rule of the new system and the old system on the business data is obtained by judging the size of the data address represented by the value of the database key value pair and the message queue data address corresponding to the business data, different data processing rules are executed on different business data based on the new system and the old system, and the controllability of gray scale release is improved.
In another embodiment, as shown in fig. 5, obtaining the second processing rule for the service data by the new system and the old system according to the system identifier includes:
s665, if the system identification is an old system identification, the old system processes the service data;
s666, if the system identification is the new system identification, the new system processes the service data.
In this embodiment, the system identifier includes an old system identifier or a new system identifier, and by determining the system identifier of the service data, if the system identifier is the old system identifier, the old system processes the service data, and if the system identifier is the new system identifier, the new system processes the service data, that is, after the gray scale release starts, it is determined whether the service data is processed by the old system or the new system according to the different system identifiers of the service data. Further, the service data of the system identifier which is the old system identifier is processed in the old system all the time and cannot be issued to the new system, and the service data of the old system identifier is sent to the new system for processing after the service data of the non-old system identifier is processed by the new system, so that complete gray level issue is realized.
In the scheme of the embodiment, by judging different system identifiers of the service data, the service data is distributed to the new system or the old system to process the service data according to different service data in the gray scale publishing process, for example, if the system identifier of the service data with high risk is the old system identifier, the service data with high risk is still processed by the old system, and the new system preferentially processes the service data with low risk, so that the risk control of gray scale publishing is facilitated, and the controllability of gray scale publishing is further increased.
To explain the method and effect of gray level publishing in this embodiment in detail, a most detailed embodiment is described below, in which the message queue is kafka message queue, and the database is redis database:
aiming at the common gray level release scene of an ATM system in the financial field, an old system of the ATM is used as a business data producer, business data is obtained from the business data producer, gray level control data is obtained from a gray level release controller, the business data and the gray level control data are written into a kafka message queue, and data and a message queue data address in the message queue are obtained; extracting gray control data in the message queue data; if the gray control data is gray starting data, acquiring a gray starting state identifier, and respectively writing the gray starting state identifier and a message queue data address corresponding to the gray starting data into key and value of a key value pair of the redis database; if the gray control data is gray end data, acquiring a gray end state identifier, deleting a key value pair of an existing database, extracting service data in message queue data, acquiring a system identifier corresponding to the service data through a data recognizer, acquiring a processing rule of a new system of the ATM and an old system of the ATM on the service data according to the system identifier, the gray state identifier and a message queue data address, performing gray release according to the processing rule of the new system of the ATM and the old system of the ATM on the service data to complete gray release of the new system of the ATM, sending a short message to a target client after the service data is processed, and informing the target client that the service data is processed, wherein the flow diagram of gray release is shown in fig. 6.
Extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring a processing rule of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address; if the key of the database key value pair does not correspond to the gray level starting state identification or the key of the database key value pair is empty, the old system of the ATM processes the service data; if the key of the database key value pair corresponds to the gray level starting state identification, if the data address represented by the value of the database key value pair is larger than the message queue data address corresponding to the service data, the old system of the ATM processes the service data; if the data address represented by the value of the database key value pair is smaller than the message queue data address corresponding to the service data, if the system identifier is an old system identifier, the old system of the ATM processes the service data; if the system identification is the new system identification, the new system of the ATM processes the service data; gray scale distribution is performed according to the processing rule of the business data by the new system of the ATM and the old system of the ATM, and as shown in fig. 7, a step schematic diagram of gray scale distribution is shown.
The method of the application can also aim at the gray scale publishing scene of the teller machine system in the financial field, the old system of the teller machine is taken as a business data producer, business data is obtained from the business data producer, gray scale control data is obtained from a gray scale publishing controller, the business data and the gray scale control data are written into a kafka message queue, by obtaining the processing rule of the new system of the teller machine and the old system of the teller machine to the business data according to the system identification, the gray state identification and the message queue data address, the gray scale issuing method and the gray scale issuing device disclosed by the application can be used for gray scale issuing under other business system scenes, and the business system scenes suitable for the gray scale issuing method and the gray scale issuing device disclosed by the application are not limited.
In the gray level publishing method, gray level control data in the message queue data is extracted by obtaining the message queue data and the message queue data address, a gray level state identifier is obtained, service data in the message queue data is extracted, a system identifier corresponding to the service data is obtained through data identification, the processing rules of the new system and the old system for the service data are obtained according to the system identifier, the gray level state identifier and the message queue data address, and gray level publishing is carried out according to the processing rules of the new system and the old system for the service data. According to the scheme of the embodiment, the service data are subjected to data identification to obtain the system identification corresponding to the service data, so that different data processing rules can be executed on different service data by a new system and an old system in the gray scale release process, and the controllability of gray scale release is improved; based on the first-in first-out characteristic of the message queue, the gray control data and the service data are written into the message queue, the control of the starting time point and the ending time point of gray release can be realized, the gray release is carried out according to the gray state identification and the data address of the message queue, the control of the starting position and the ending position of the gray release at the specific position of the message queue can be realized, and the controllability of the gray release is further improved.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a gray scale distribution device for implementing the gray scale distribution method. The solution of the problem provided by the device is similar to the solution described in the above method, so the specific definition in one or more embodiments of the gray scale publishing device provided below can refer to the definition of the gray scale publishing method in the above, and details are not described here.
In one embodiment, as shown in fig. 8, there is provided a gray scale issuing apparatus 100 including: a data obtaining module 120, a gray level status identification obtaining module 140, a processing rule obtaining module 160, and a gray level publishing module 180, wherein:
a data obtaining module 120, configured to obtain message queue data and a message queue data address.
The gray level status identifier obtaining module 140 is configured to extract the gray level control data in the message queue data to obtain the gray level status identifier.
The processing rule obtaining module 160 is configured to extract service data in the message queue data, obtain a system identifier corresponding to the service data through data identification, and obtain a processing rule for the service data by the new system and the old system according to the system identifier, the gray state identifier, and the message queue data address.
And the gray release module 180 is used for performing gray release according to the processing rules of the new system and the old system on the service data.
In the gray level publishing device, the gray level control data in the message queue data is extracted by obtaining the message queue data and the message queue data address, the gray level state identification is obtained, the service data in the message queue data is extracted, the system identification corresponding to the service data is obtained through data identification, the processing rules of the new system and the old system for the service data are obtained according to the system identification, the gray level state identification and the message queue data address, and the gray level publishing is carried out according to the processing rules of the new system and the old system for the service data. According to the scheme of the embodiment, the service data are subjected to data identification to obtain the system identification corresponding to the service data, so that different data processing rules can be executed on different service data by a new system and an old system in the gray scale release process, and the controllability of gray scale release is improved; based on the first-in first-out characteristic of the message queue, the gray control data and the service data are written into the message queue, the control of the starting time point and the ending time point of gray release can be realized, the gray release is carried out according to the gray state identification and the data address of the message queue, the control of the starting position and the ending position of the gray release at the specific position of the message queue can be realized, and the controllability of the gray release is further improved.
In one embodiment, the gray state identification acquisition module 140 is further configured to extract gray control data from the message queue data; and if the gray control data is gray starting data, acquiring a gray starting state identifier, and writing the gray starting state identifier and the message queue data address corresponding to the gray starting data into the key and the value of the database key value pair respectively.
In one embodiment, the gray state identifier obtaining module 140 is further configured to obtain the gray end state identifier and delete the existing database key value pair if the gray control data is the gray end data.
In one embodiment, the processing rule obtaining module 160 is further configured to extract service data in the message queue data, obtain a system identifier corresponding to the service data through data identification, and read a database key value pair; if the key of the database key value pair does not correspond to the gray scale starting state identifier or the key of the database key value pair is empty, the old system processes the service data; and if the key of the database key value pair corresponds to the gray scale starting state identifier, acquiring a first processing rule of the new system and the old system for the service data according to the value of the database key value pair, the message queue data address and the system identifier.
In one embodiment, the processing rule obtaining module 160 is further configured to process the service data by the old system if the data address represented by the value of the database key-value pair is greater than the message queue data address corresponding to the service data; and if the data address represented by the value of the database key value pair is smaller than the message queue data address corresponding to the service data, acquiring a second processing rule of the new system and the old system on the service data according to the system identification.
In one embodiment, the processing rule obtaining module 160 is further configured to process the service data by the old system if the system identifier is the old system identifier; and if the system identifier is the new system identifier, the new system processes the service data.
The respective modules in the above-mentioned gray scale distribution apparatus can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the grey scale start state identification and the message queue data address. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a gray scale publishing method.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
obtaining message queue data and a message queue data address;
extracting gray level control data in the message queue data to obtain a gray level state identifier;
extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring processing rules of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address;
and performing gray scale release according to the processing rules of the new system and the old system on the service data.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
extracting gray control data in the message queue data; and if the gray control data is gray starting data, acquiring a gray starting state identifier, and writing the gray starting state identifier and the message queue data address corresponding to the gray starting data into the key and the value of the database key value pair respectively.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and if the gray control data is gray end data, acquiring a gray end state identifier and deleting the existing database key value pair.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and reading a database key value pair; if the key of the database key value pair does not correspond to the gray scale starting state identifier or the key of the database key value pair is empty, the old system processes the service data; and if the key of the database key value pair corresponds to the gray level starting state identification, acquiring a first processing rule of the new system and the old system on the service data according to the value of the database key value pair, the message queue data address and the system identification.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
if the data address represented by the value of the database key value pair is larger than the message queue data address corresponding to the service data, the old system processes the service data; and if the data address represented by the value of the database key value pair is smaller than the message queue data address corresponding to the service data, acquiring a second processing rule of the new system and the old system on the service data according to the system identification.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
if the system identifier is an old system identifier, the old system processes the service data; and if the system identifier is the new system identifier, the new system processes the service data.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, performs the steps of:
obtaining message queue data and a message queue data address;
extracting gray level control data in the message queue data to obtain a gray level state identifier;
extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring processing rules of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address;
and performing gray scale release according to the processing rules of the new system and the old system on the service data.
In one embodiment, the computer program when executed by the processor further performs the steps of:
extracting gray control data in the message queue data; and if the gray control data is gray starting data, acquiring a gray starting state identifier, and writing the gray starting state identifier and the message queue data address corresponding to the gray starting data into the key and the value of the database key value pair respectively.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and if the gray control data is gray end data, acquiring a gray end state identifier and deleting the existing database key value pair.
In one embodiment, the computer program when executed by the processor further performs the steps of:
extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and reading a database key value pair; if the key of the database key value pair does not correspond to the gray scale starting state identifier or the key of the database key value pair is empty, the old system processes the service data; and if the key of the database key value pair corresponds to the gray scale starting state identifier, acquiring a first processing rule of the new system and the old system for the service data according to the value of the database key value pair, the message queue data address and the system identifier.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the data address represented by the value of the database key value pair is larger than the message queue data address corresponding to the service data, the old system processes the service data; and if the data address represented by the value of the database key value pair is smaller than the message queue data address corresponding to the service data, acquiring a second processing rule of the new system and the old system on the service data according to the system identification.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the system identifier is an old system identifier, the old system processes the service data; and if the system identifier is the new system identifier, the new system processes the service data.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the steps of:
obtaining message queue data and a message queue data address;
extracting gray level control data in the message queue data to obtain a gray level state identifier;
extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring processing rules of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address;
and performing gray scale release according to the processing rules of the new system and the old system on the service data.
In one embodiment, the computer program when executed by the processor further performs the steps of:
extracting gray control data in the message queue data; and if the gray control data is gray starting data, acquiring a gray starting state identifier, and writing the gray starting state identifier and the message queue data address corresponding to the gray starting data into the key and the value of the database key value pair respectively.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and if the gray control data is gray end data, acquiring a gray end state identifier and deleting the existing database key value pair.
In one embodiment, the computer program when executed by the processor further performs the steps of:
extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and reading a database key value pair; if the key of the database key value pair does not correspond to the gray scale starting state identifier or the key of the database key value pair is empty, the old system processes the service data; and if the key of the database key value pair corresponds to the gray scale starting state identifier, acquiring a first processing rule of the new system and the old system for the service data according to the value of the database key value pair, the message queue data address and the system identifier.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the data address represented by the value of the database key value pair is larger than the message queue data address corresponding to the service data, the old system processes the service data; and if the data address represented by the value of the database key value pair is smaller than the message queue data address corresponding to the service data, acquiring a second processing rule of the new system and the old system on the service data according to the system identification.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the system identifier is an old system identifier, the old system processes the service data; and if the system identifier is the new system identifier, the new system processes the service data.
It should be noted that the gray scale publishing method and apparatus disclosed in the present application can be used for gray scale publishing in the financial field, and can also be used for gray scale publishing in any field except the financial field, the application field of the gray scale publishing method and apparatus disclosed in the present application is not limited, and the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) related in the present application are both information and data that are authorized by the user or are sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include a Read-Only Memory (ROM), a magnetic tape, a floppy disk, a flash Memory, an optical Memory, a high-density embedded nonvolatile Memory, a resistive Random Access Memory (ReRAM), a Magnetic Random Access Memory (MRAM), a Ferroelectric Random Access Memory (FRAM), a Phase Change Memory (PCM), a graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A gray scale publishing method, comprising:
obtaining message queue data and a message queue data address;
extracting gray level control data in the message queue data to obtain a gray level state identifier;
extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and acquiring processing rules of a new system and an old system on the service data according to the system identifier, the gray state identifier and the message queue data address;
and issuing the gray scale according to the new system and the old system to the processing rule of the service data.
2. The gray scale publishing method according to claim 1, wherein the extracting gray scale control data from the message queue data to obtain a gray scale state identifier comprises:
extracting gray control data in the message queue data;
and if the gray control data is gray starting data, acquiring a gray starting state identifier, and writing the gray starting state identifier and the message queue data address corresponding to the gray starting data into the key and the value of the database key value pair respectively.
3. The method of claim 2, wherein the extracting the gray control data from the message queue data to obtain the gray state identifier further comprises:
and if the gray control data is gray end data, acquiring a gray end state identifier and deleting the existing database key value pair.
4. The gray scale publishing method according to claim 2, wherein the extracting the service data in the message queue data, obtaining the system identifier corresponding to the service data through data identification, and obtaining the processing rules of the new system and the old system for the service data according to the system identifier, the gray scale state identifier and the message queue data address comprises:
extracting service data in the message queue data, acquiring a system identifier corresponding to the service data through data identification, and reading the database key value pair;
if the key of the database key value pair does not correspond to the gray scale starting state identifier or the key of the database key value pair is empty, the old system processes the business data;
and if the key of the database key value pair corresponds to the gray scale starting state identifier, acquiring a first processing rule of the new system and the old system on the service data according to the value of the database key value pair, the message queue data address and the system identifier.
5. The gray scale publishing method according to claim 4, wherein the obtaining of the first processing rule of the new system and the old system for the business data according to the value of the database key-value pair, the message queue data address and the system identifier comprises:
if the data address represented by the value of the database key value pair is larger than the message queue data address corresponding to the service data, the old system processes the service data;
and if the data address represented by the value of the database key value pair is smaller than the message queue data address corresponding to the service data, acquiring a second processing rule of the new system and the old system on the service data according to the system identification.
6. The gray scale publishing method according to claim 5, wherein the obtaining of the second processing rule of the new system and the old system on the service data according to the system identifier comprises:
if the system identifier is an old system identifier, the old system processes the service data;
and if the system identifier is the new system identifier, the new system processes the service data.
7. A gradation issuance apparatus, characterized by comprising:
the data acquisition module is used for acquiring message queue data and a message queue data address;
the gray state identification acquisition module is used for extracting gray control data in the message queue data to acquire a gray state identification;
the processing rule obtaining module is used for extracting the service data in the message queue data, obtaining a system identifier corresponding to the service data through data identification, and obtaining the processing rules of a new system and an old system for the service data according to the system identifier, the gray state identifier and the message queue data address;
and the gray release module is used for performing gray release on the processing rule of the service data according to the new system and the old system.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202210092254.5A 2022-01-26 2022-01-26 Gray scale distribution method and device, computer equipment and storage medium Pending CN114489770A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210092254.5A CN114489770A (en) 2022-01-26 2022-01-26 Gray scale distribution method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210092254.5A CN114489770A (en) 2022-01-26 2022-01-26 Gray scale distribution method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114489770A true CN114489770A (en) 2022-05-13

Family

ID=81474559

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210092254.5A Pending CN114489770A (en) 2022-01-26 2022-01-26 Gray scale distribution method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114489770A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115185582A (en) * 2022-09-15 2022-10-14 畅捷通信息技术股份有限公司 Gray scale publishing method and device for multiple tenants and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115185582A (en) * 2022-09-15 2022-10-14 畅捷通信息技术股份有限公司 Gray scale publishing method and device for multiple tenants and storage medium
CN115185582B (en) * 2022-09-15 2022-11-18 畅捷通信息技术股份有限公司 Gray scale publishing method and device for multiple tenants and storage medium

Similar Documents

Publication Publication Date Title
US10255108B2 (en) Parallel execution of blockchain transactions
US9465880B2 (en) Optimizing storage in a publish / subscribe environment
CN111444192B (en) Method, device and equipment for generating Hash of global state in block chain type account book
CN113094434A (en) Database synchronization method, system, device, electronic equipment and medium
CN106980665A (en) Data dictionary implementation method, device and data dictionary management system
CN114706867A (en) Data synchronization method and device, electronic equipment and storage medium
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
CN109343962A (en) Data processing method, device and distribution service
CN116431878A (en) Vector retrieval service method, device, equipment and storage medium thereof
CN114489770A (en) Gray scale distribution method and device, computer equipment and storage medium
CN112286457B (en) Object deduplication method and device, electronic equipment and machine-readable storage medium
US11797892B1 (en) Systems and methods for customizing user interfaces using artificial intelligence
CN113297267A (en) Data caching and task processing method, device, equipment and storage medium
CN112035428A (en) Distributed storage system, method, apparatus, electronic device, and storage medium
CN113329078B (en) Data storage method and device
US20220083507A1 (en) Trust chain for official data and documents
CN110266610B (en) Traffic identification method and device and electronic equipment
CN113971428A (en) Data processing method, system, device, program product and storage medium
CN117422556B (en) Derivative transaction system, device and computer medium based on replication state machine
US12026163B1 (en) Metric data processing and storage
CN110716885B (en) Data management method and device, electronic equipment and storage medium
US20210248162A1 (en) Parallel data transfer from one database to another database
CN113987322A (en) Index data query method and device, computer equipment and computer program product
CN117133076A (en) Queuing method, queuing device, computer equipment and storage medium
CN117221247A (en) Batch message sending method, device, communication equipment and storage medium

Legal Events

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