CN108363619B - Service flow control method, server, and computer-readable storage medium - Google Patents

Service flow control method, server, and computer-readable storage medium Download PDF

Info

Publication number
CN108363619B
CN108363619B CN201810189941.2A CN201810189941A CN108363619B CN 108363619 B CN108363619 B CN 108363619B CN 201810189941 A CN201810189941 A CN 201810189941A CN 108363619 B CN108363619 B CN 108363619B
Authority
CN
China
Prior art keywords
service
node
configuration information
zookeeper
switch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810189941.2A
Other languages
Chinese (zh)
Other versions
CN108363619A (en
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.)
Shenzhen Coocaa Network Technology Co Ltd
Original Assignee
Shenzhen Coocaa Network Technology Co Ltd
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 Shenzhen Coocaa Network Technology Co Ltd filed Critical Shenzhen Coocaa Network Technology Co Ltd
Priority to CN201810189941.2A priority Critical patent/CN108363619B/en
Publication of CN108363619A publication Critical patent/CN108363619A/en
Application granted granted Critical
Publication of CN108363619B publication Critical patent/CN108363619B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a service flow control method, a server and a computer readable storage medium, wherein the service flow control method comprises the following steps: receiving an operation request of a service, accessing the service to a zookeeper, judging whether node configuration information of the service is stored in the zookeeper, if so, acquiring the configuration information, and controlling the service flow according to the configuration information; whether each node of the service operates is controlled through configuration information of the nodes of the service stored in the zookeeper, so that the phenomenon that the processing performance of the server is influenced due to large load of the server caused by synchronous operation of the nodes which do not need to operate in the service is avoided.

Description

Service flow control method, server, and computer-readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a service flow control method, a server, and a computer-readable storage medium.
Background
zookeeper is a distributed, open source distributed application coordination service, which is software that provides a consistent service for distributed applications, and provides functions including: configuration maintenance, name service, distributed synchronization, group service, etc. One zookeeper server may be connected to multiple application servers. A service comprises a plurality of service execution nodes, and each service execution node is executed in one of the application servers.
Important complex services in internet application have a plurality of processes, the processes are divided into a main process and a secondary process, the main process is a key process, and in one service, the secondary process may not be necessary in certain operating environments; therefore, the whole process is operated in the service operation process, which brings a large load to the server and seriously affects the processing performance of the server.
Disclosure of Invention
The invention mainly aims to provide a service flow control method, a server and a computer readable storage medium, aiming at solving the problem that whether the flow in the service is dynamically controlled to be carried out when the service is in a running state, thereby reducing the resource consumption of the server.
In order to achieve the above object, an embodiment of the present invention provides a service flow control method, where the service flow control method includes:
receiving a service operation request, and accessing the service to a zookeeper;
judging whether a service switch node table in the zookeeper stores node configuration information of the service or not;
if the service switch node table in the zookeeper stores the node configuration information of the service, the node configuration information is acquired, the service is controlled to start a main process according to the node configuration information, and a secondary process is forbidden.
Optionally, after the step of determining whether the node configuration information of the service is stored in the service switch node table in the zookeeper, the method further includes:
and generating a template table based on the initial state of each service flow control configuration information, and storing the template table into a database.
Optionally, after the step of generating a template table based on the initial state of each service flow control configuration information and storing the template table in a database, the method further includes:
if the service switch node table in the zookeeper does not store the node configuration information of the service, calling a template table in a database, reading the configuration information of each node of the service in the template table, and storing the configuration information into the service switch node table.
Optionally, after the step of storing the configuration information in the service switch node table, the method further includes:
and creating a control node of the service on the zookeeper, storing the configuration information of the service node in the service switch node table to the control node, and controlling the zookeeper to monitor the service.
Optionally, the step of controlling the service to start the primary flow according to the node configuration information, and disabling the secondary flow includes:
judging the setting state of the service node configuration information;
if the set state is open, the node process is operated, and the process is a main process;
if the set state is forbidden, the node flow is not operated, and the flow is a sub-flow.
Optionally, the service flow control method further includes:
extracting service node configuration information in the service node switching table based on the modification request;
and modifying the service node configuration information in the service node switch table, and correspondingly storing the modified configuration information into the service node switch table to obtain a new service node switch table.
Optionally, after the step of modifying the service node configuration information in the service node switch table and correspondingly storing the modified configuration information in the service node switch table to obtain a new service node switch table, the method includes:
and correspondingly storing the new service node switching table to the control node corresponding to the zookeeper, and updating the node configuration information of the service on the control node corresponding to the zookeeper.
Optionally, the service flow control method further includes:
when node configuration information of the service stored in the zookeeper node is modified, the modified configuration information is controlled to be updated to the corresponding zookeeper node based on the preset node modification service.
The present invention also provides a server, comprising: one or more processors; a storage, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the service flow control method described above.
The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a service flow control program, and the service flow control program, when executed by a processor, implements the steps of the service flow control method.
The method comprises the steps of receiving an operation request of a service, accessing the service to a zookeeper, judging whether node configuration information of the service is stored in the zookeeper, if the node configuration information of the service is stored in the zookeeper, acquiring the configuration information, and controlling the service flow according to the configuration information; whether each node of the service operates is controlled through configuration information of the nodes of the service stored in the zookeeper, so that the phenomenon that the nodes which do not need to operate in the service also operate synchronously to cause large load of the server and influence on the processing performance of the server is avoided.
Drawings
FIG. 1 is a block diagram of an alternative server for implementing various embodiments of the present invention;
FIG. 2 is a flowchart illustrating a service flow control method according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating a service flow control method according to another embodiment of the present invention;
FIG. 4 is a flowchart illustrating a service flow control method according to another embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "part", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning by themselves. Thus, "module", "component" or "unit" may be used mixedly.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a server according to an embodiment of the present invention.
Fig. 1 shows a block diagram of an exemplary server 1 suitable for implementing an embodiment of the invention. The server 1 shown in fig. 1 is only an example, and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in fig. 1, the server 1 is in the form of a general purpose computing device. The components of the server 1 may include, but are not limited to: one or more processors or processing units 12, a system memory 11, and a bus 15 that couples various system components including the system memory 11 and the processing units 12.
Bus 15 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The server 1 typically includes a variety of computer system readable media. These media may be any available media that can be accessed by server 1 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 11 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)111 and/or cache memory 112. The server 1 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, the storage system 113 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 1, commonly referred to as a "hard drive"). Although not shown in FIG. 1, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 15 by one or more data media interfaces. Memory 11 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
Program/utility 114 having a set (at least one) of program modules 1141 may be stored, for example, in memory 11, such program modules 1141 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 1141 generally perform the functions and/or methodologies of embodiments of the invention as described herein.
The server 1 may also communicate with one or more external devices 3 (e.g., keyboard, pointing device, display 2, etc.), with one or more devices that enable a user to interact with the server 1, and/or with any devices (e.g., network card, modem, etc.) that enable the server 1 to communicate with one or more other computing devices. Such communication may be via an input/output (I/O) interface 13. Also, the server 1 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) through the network adapter 3. As shown, the network adapter 14 communicates with the other modules of the server 1 via a bus 15. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the server 1, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 12 executes various functional applications and data processing, for example, implementing a service configuration method provided by an embodiment of the present invention, by executing a program stored in the system memory 11.
As one type of computer storage medium, any combination of one or more computer-readable media may be utilized, as illustrated in FIG. 1. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CDROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
Based on the above server structure, computer-readable storage medium, and communication network, embodiments of the service flow control method and server of the present invention are provided.
The invention provides a service flow control method, in an embodiment of the service flow control method, referring to fig. 2, the method includes:
step S10, receiving a service operation request, and accessing the service to zookeeper;
when a certain service is triggered and enters the running process, the service sends a running request, after the running request is received, the service is accessed to the zookeeper, and the zookeeper monitors the running service. The method comprises the steps that a service sends an operation request once in the same time period, and after the operation requests of different services are sent to a zookeeper, the operation requests are correspondingly stored in a control node in the zookeeper of the service.
Step S20, judging whether a service switch node table in the zookeeper stores the node configuration information of the service;
the node configuration information and the information contained in the service flow control process comprise address, service, starting, forbidding, time point, running time sequence and the like, and the method is mainly used for starting or forbidding the service nodes. And the service node switch table stores configuration information of each node in each service, namely each node of each service corresponds to the on or off state.
The node configuration information of the service is stored in a control node in the zookeeper, and when an operation request sent by a certain service is received by the zookeeper, whether the node configuration information of the corresponding service is stored or not is searched on the zookeeper.
Step S30, if the node configuration information of the service is stored in the service switch node table in the zookeeper, the node configuration information is acquired, the service is controlled to start a main process according to the node configuration information, and an auxiliary process is forbidden.
On the basis of the above steps, when the zookeeper stores the configuration information of the corresponding service node, the configuration information is acquired and stored in the local cache, the whole process of the service is controlled according to the configuration information, the main process which must be operated is started, and unnecessary secondary processes are forbidden, so that the processing efficiency of the server is prevented from being influenced by overlarge load of the service.
To assist understanding, an example is given, for example, a service a, which includes five flows, i.e., a flow a1, a2, a3, a4 and a5, i.e., the service a includes five nodes to be controlled. The service A sends an operation request, and the zookeeper stores node configuration information I of the service A, wherein a1 stored in the configuration information I is a main flow, the state is open, a2 is a main flow, the state is open, a3 and a4 are auxiliary flows, the state is forbidden, a5 is a main flow, and the state is open; at this time, the configuration information I is read to control the operation flow of the service a, and then the service a operates the a1, a2 and a5 flows therein, and does not operate the a3 and a4 flows.
In this embodiment, by receiving a service operation request and accessing the service to a zookeeper, whether node configuration information of the service is stored in the zookeeper is judged, and if the node configuration information of the service is stored in the zookeeper, the configuration information is acquired, and the service flow is controlled according to the configuration information; through configuration information of the nodes of the service stored in the zookeeper, whether each node of the service operates or not is controlled, so that the problem that the processing performance of the server is influenced due to large load of the server caused by synchronous operation of the nodes which do not need to operate in the service is avoided.
Optionally, in another embodiment of the service flow control method of the present invention, after the step of determining whether the node configuration information of the service is stored in the service switch node table in the zookeeper, the step of step S20 further includes:
step S21, generating a template table based on the initial state of each service flow control configuration information, and storing the template table in a database.
An initial state, which is an initial state of each process of the service, for example, the initial states of all the processes of the service are all open. Then, a template table is generated from the node configuration information of the service in this initial state, and the template table is stored in the database.
After the step of generating the template table based on the initial state of each service flow control configuration information in step S21, the method further includes:
step S22, if the node configuration information of the service is not stored in the service switch node table in the zookeeper, calling a template table in the database, reading the configuration information of each node of the service in the template table, and storing the configuration information in the service switch node table.
For a received running service request, but the node configuration information of the service is not stored in the zookeeper, at this time, the flow node of the service cannot be controlled according to the node configuration information in the service node switching table. That is, the service node switch table in the above embodiment does not store the node-related configuration information of the service, at this time, the template table in the database may be called, the node configuration information in the template table is read, the configuration information of each node of the service is set, and the set node configuration information of the service is stored in the service node switch table again, that is, a new service node switch table is obtained.
And correspondingly extracting the configuration information of each node serving on the basis of the template table obtained in the step, and storing the configuration information into a service node switch table. And storing the service node switch table to the zookeeper, namely when a certain service sends out an operation request and the node configuration information of the service is stored in the service node switch table, controlling the operation state of the service by the zookeeper according to the service node switch table.
For example, the template table is:
service Node 1 Node 2 Node N
A a1 (opening) a2 (forbidden) aN (open)
B b1 (opening) b2 (opening) bN (forbidden)
N n1 (forbidden) n2 (opening) nN (open)
The service node switching table is as follows:
service Node 1 Node 2 Node N
A a1 (opening) a2 (forbidden) aN (open)
B b1 (opening) b2 (opening) bN (forbidden)
C c1 (opening) c2 (opening) cN (forbidden)
D d1 (forbidden) d2 (opening) dN (forbidden)
When the service sending the operation request is X, the service X is not stored in the service node switch table, the configuration information of each node of the service X is extracted from the template table and is stored in the service node switch table, and the following new service node switch table is obtained:
service Node 1 Node 2 Node N
A a1 (opening) a2 (forbidden) aN (open)
B b1 (opening) b2 (opening) bN (forbidden)
C c1 (opening) c2 (opening) cN (forbidden)
D d1 (forbidden) d2 (opening) dN (forbidden)
X x1 (forbidden) x2 (forbidden) xN (open)
Step S23, a control node of the service is created on the zookeeper, the configuration information of the service node is stored on the control node, and the zookeeper monitors the service.
For the service X, a control node for controlling the service X is newly established on the zookeeper, the control node stores the node configuration information of the service X, and then the zookeeper monitors and controls the operation flow of the service X according to the node configuration information of the service X stored on the control node.
For the control node on the zookeeper, only when the service sends out an operation request, a corresponding control node is created on the zookeeper, and the control node stores the node configuration information of the corresponding service.
In this embodiment, a template table is established to record the initial state of each service node, a service node switch table is established according to the template table, and configuration information of each service node is stored, so that the problem that a service which is not stored in the service node switch table cannot control the opening or the disabling of the service flow in the service operation process is avoided, the service node switch table is updated, and the node configuration information of the service is stored in zookeeper to control the service flow. And only when the service sends out an operation request, a corresponding control node is created on the zookeeper, so that the load of the zookeeper is reduced, and the processing efficiency of the zookeeper is improved.
Optionally, in another embodiment of the service flow control method of the present invention, the step of controlling the service to open the main flow according to the node configuration information in step S30, and the step of disabling the sub-flow includes:
judging the setting state of the service node configuration information;
if the set state is open, the node process is operated, and the process is a main process;
if the set state is forbidden, the node flow is not operated, and the flow is a sub-flow.
And determining whether the node is set to be started or forbidden by judging the set state in the service node configuration information, and further controlling the running state of the node, wherein the running node is the main flow of the service, and the forbidden node is the auxiliary flow of the service.
Optionally, in another embodiment of the service flow control method of the present invention, as shown in fig. 4, the service flow control method further includes:
step S40, based on the modification request, extracting the node configuration information in the service node switch list;
and step S41, modifying the service node configuration information in the service node switch table, and correspondingly storing the modified configuration information in the service node switch table to obtain a new service node switch table.
And extracting service node configuration information in the service node switch table, modifying the service node configuration information according to requirements, namely, the service node configuration information is inconsistent with the previously stored service node configuration information, and correspondingly storing the modified service node configuration information into the service node switch table to further obtain a new service node switch table.
For example, for service a in the service node switching table above, a1 (on), a2 (disabled) … aN (on); modifying the node configuration information of the service A according to the new requirement to a1 (disabled) and a2 (enabled) … aN (disabled); then, at this time, a new service node switching table is obtained:
service Node 1 Node 2 Node N
A a1 (forbidden) a2 (opening) aN (forbidden)
B b1 (opening) b2 (opening) bN (forbidden)
C c1 (opening) c2 (opening) cN (forbidden)
D d1 (forbidden) d2 (opening) dN (forbidden)
And step S42, correspondingly storing the new service node switching table to the control node corresponding to the zookeeper, and updating the node configuration information of the service on the control node corresponding to the zookeeper.
The newly obtained node configuration information a1 (disabled) and a2 (enabled) … aN (disabled) of the service a is correspondingly stored in the control node in the zookeeper, and the previous node configuration information of the service a is covered or deleted, that is, the node configuration information of the service a on the zookeeper is updated. And when the operation request of the service A is received again, the zookeeper controls the node flow of the service A according to the new node configuration information of the service A.
To assist in understanding node configuration information of the modified service, as an example of a scenario application, the on-off state of each service and each node of each service is extracted from the service node on-off table, and a button for modifying the state is provided. When a certain switch state is to be modified, firstly selecting a service, then selecting a node, selecting a switch to be modified, clicking an on/off button, and modifying the switch state of the corresponding service node. After the switch state of the service node is modified, further, the configuration information of the service node in the service node switch table is modified, and then the configuration information of the control node in the zookeeper is modified. Once the configuration information of the corresponding control node in the zookeeper is modified, the node in the service can acquire the changed data by monitoring, and the node switch configuration information of the service is updated in the local cache.
In this embodiment, when the node configuration information of a certain service needs to be modified, the configuration information of the service is directly modified, and the modified configuration information is stored again in the control node corresponding to the zookeeper, so that new control over the node of the service can be achieved without restarting the service. Furthermore, the convenience of controlling the service node is optimized, and the complicated step that the new control of the service can be realized only by restarting the service after the node configuration information of the service is modified is avoided.
Optionally, in another embodiment of the service flow control method of the present invention, the service flow control method further includes:
when node configuration information of the service stored in the zookeeper node is modified, the modified configuration information is controlled to be updated to the corresponding zookeeper node based on the preset node modification service.
A specific service, namely a preset node modification service, is extracted, and the zookeeper node modification service is specially provided for changing the zookeeper node, because direct operation of the zookeeper is not safe, and zookeeper node data is stored after serialization, the content cannot be seen through direct viewing, and the operation through a program is needed.
To assist in understanding the present invention, the implementation process of the service flow control method of the present invention will now be described with reference to an example. Take a SWITCH (QUEUE _ WRITE _ SWITCH) for controlling data transmission to the message QUEUE as an example:
step 1: inserting a record of a QUEUE _ WRITE _ SWITCH node into a database template table, and setting the SWITCH state of the record to be forbidden;
step 2: in a service program, adding an attribute QUEUE _ WRITE _ SWITCH to a local SWITCH configuration class, and defaulting without assignment;
step 3: the zokeeper node path is/config/switchNode/service ip address, but the node is not created in advance, but has service creation;
step 4: service starting, acquiring data of a node/config/switchNode/service ip address, and establishing monitoring of the node; if the node data is empty, step5 is executed, otherwise, step6 is executed;
step 5: and acquiring the node of the service in the template table, writing the node into a service node switch table of the database, and recording the zookeeper address, the service and the switch configuration. At the same time, configure the switch to write an object (in the form of a map) that maps keys to values into the zookeeper node;
step 6: reflecting the state of the SWITCH QUEUE _ WRITE _ SWITCH to a local SWITCH configuration class according to data acquired from a zookeeper, and setting the value of the attribute;
step 7: and after the nodes in service monitor the data change, the nodes also reflect and modify the local switch configuration class.
step 8: the state of a service-SWITCH QUEUE _ WRITE _ SWITCH is modified to be on.
step 9: in a management background, selecting a service, and then selecting a node of a service I;
step 10: finding a SWITCH QUEUE _ WRITE _ SWITCH in all the displayed SWITCH lists, and clicking to open;
step 11: matching the record of the service node from the service node switching table according to the selected service and the selected node;
step 12: modifying the record in the previous step, and setting the SWITCH state corresponding to QUEUE _ WRITE _ SWITCH in the SWITCH configuration to be on;
step 13: finding node data according to the recorded zookeeper path, modifying the value of a key QUEUE _ WRITE _ SWITCH to be open, and rewriting the zookeeper;
step 14: after the last step is executed, step7 will trigger execution;
through the steps, a switch control service can be established, and the switch state and the program flow can be controlled without restarting the service. And different nodes of the same service may be controlled differently.
The present invention also provides a server, comprising: one or more processors; a storage, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the service flow control method described above.
The invention further provides a computer-readable storage medium, wherein a service flow control program is stored on the computer-readable storage medium, and when being executed by a processor, the service flow control program realizes the steps of the service flow control method.
In the embodiments of the server and the computer-readable storage medium of the present invention, all technical features of the embodiments of the service flow control method are included, and the expanding and explaining contents of the specification are basically the same as those of the embodiments of the service flow control method, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a mobile terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (7)

1. A service flow control method is characterized by comprising the following steps:
receiving a service operation request, accessing the service to a zookeeper, and creating a corresponding control node on the zookeeper, wherein the control node stores node configuration information of the corresponding service;
judging whether a service switch node table in a zookeeper stores node configuration information of the service, wherein the node configuration information is the state of each node of each service corresponding to being opened or forbidden;
if the service switch node table in the zookeeper stores the node configuration information of the service, acquiring the node configuration information, controlling the service to start a main process and forbidding an auxiliary process according to the node configuration information;
generating a template table based on the initial state of each service process control configuration information, and storing the template table into a database;
if the service switch node table in the zookeeper does not store the node configuration information of the service, calling a template table in a database, reading the configuration information of each node of the service in the template table, and storing the configuration information into the service switch node table;
extracting service node configuration information in the service node switching table based on the modification request;
and modifying the service node configuration information in the service node switch table, and correspondingly storing the modified configuration information into the service node switch table to obtain a new service node switch table.
2. The service flow control method of claim 1, wherein after the step of storing the configuration information in a service switch node table, further comprising:
and creating a control node of the service on the zookeeper, storing the configuration information of the service node in the service switch node table to the control node, and controlling the zookeeper to monitor the service.
3. The method for controlling service flow according to claim 1, wherein the step of controlling the service to open the primary flow according to the node configuration information and the step of disabling the secondary flow comprises:
judging the setting state of the service node configuration information;
if the set state is open, the node process is operated, and the process is a main process;
if the set state is forbidden, the node flow is not operated, and the flow is a sub-flow.
4. The service flow control method according to claim 1, wherein after the step of modifying the service node configuration information in the service node switch table and correspondingly storing the modified configuration information in the service node switch table to obtain a new service node switch table, the method comprises:
and correspondingly storing the new service node switching table to the control node corresponding to the zookeeper, and updating the node configuration information of the service on the control node corresponding to the zookeeper.
5. The service flow control method of claim 4, wherein the service flow control method further comprises:
when node configuration information of the service stored in the zookeeper node is modified, the modified configuration information is controlled to be updated to the corresponding zookeeper node based on the preset node modification service.
6. A server, characterized in that the server comprises: one or more processors; a memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the service flow control method of any of claims 1-5.
7. A computer-readable storage medium, having stored thereon a service flow control program which, when executed by a processor, implements the steps of the service flow control method according to any one of claims 1 to 5.
CN201810189941.2A 2018-03-07 2018-03-07 Service flow control method, server, and computer-readable storage medium Active CN108363619B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810189941.2A CN108363619B (en) 2018-03-07 2018-03-07 Service flow control method, server, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810189941.2A CN108363619B (en) 2018-03-07 2018-03-07 Service flow control method, server, and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN108363619A CN108363619A (en) 2018-08-03
CN108363619B true CN108363619B (en) 2021-11-30

Family

ID=63003884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810189941.2A Active CN108363619B (en) 2018-03-07 2018-03-07 Service flow control method, server, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN108363619B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104767641A (en) * 2015-04-01 2015-07-08 北京京东尚科信息技术有限公司 Flow adjusting method, device and system
CN106990992A (en) * 2017-04-10 2017-07-28 深圳乐信软件技术有限公司 service configuration method, device, server and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014077918A1 (en) * 2012-11-19 2014-05-22 Board Of Regents, The University Of Texas System Robustness in a scalable block storage system
US9923768B2 (en) * 2015-04-14 2018-03-20 International Business Machines Corporation Replicating configuration between multiple geographically distributed servers using the rest layer, requiring minimal changes to existing service architecture
CN106909456A (en) * 2015-12-22 2017-06-30 北京奇虎科技有限公司 A kind of information acquisition method and device
CN106911739B (en) * 2015-12-23 2020-02-07 北京奇虎科技有限公司 Information distribution method and device
CN105824618A (en) * 2016-03-10 2016-08-03 浪潮软件集团有限公司 Real-time message processing method for Storm
CN107341051A (en) * 2016-05-03 2017-11-10 北京京东尚科信息技术有限公司 Cluster task coordination approach, system and device
CN107172230B (en) * 2017-07-24 2020-05-22 北京赛特斯信息科技股份有限公司 Method for realizing service node communication address discovery based on third-party database

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104767641A (en) * 2015-04-01 2015-07-08 北京京东尚科信息技术有限公司 Flow adjusting method, device and system
CN106990992A (en) * 2017-04-10 2017-07-28 深圳乐信软件技术有限公司 service configuration method, device, server and storage medium

Also Published As

Publication number Publication date
CN108363619A (en) 2018-08-03

Similar Documents

Publication Publication Date Title
WO2019179026A1 (en) Electronic device, method for automatically generating cluster access domain name, and storage medium
US11243921B2 (en) Database expansion system, equipment, and method of expanding database
CN109284180B (en) Task scheduling method and device, electronic equipment and storage medium
CN111491012B (en) SaaS multi-tenant data isolation access method and device, electronic equipment and storage medium
CN110874383B (en) Data processing method and device and electronic equipment
CN113010224B (en) Front-end micro-servitization method, front-end micro-servitization device, computer equipment and storage medium
CN109412967B (en) System flow control method and device based on token, electronic equipment and storage medium
CN107817962B (en) Remote control method, device, control server and storage medium
CN112860953A (en) Data importing method, device, equipment and storage medium of graph database
CN115795211A (en) Page display method, device, system, equipment and storage medium
CN109033456B (en) Condition query method and device, electronic equipment and storage medium
CN114489954A (en) Tenant creation method based on virtualization platform, tenant access method and equipment
CN114358742A (en) Workflow execution method, device, equipment and storage medium
CN114356521A (en) Task scheduling method and device, electronic equipment and storage medium
CN111031126B (en) Cluster cache sharing method, system, equipment and storage medium
US6864905B2 (en) Method to redisplay active panels
CN113220342A (en) Centralized configuration method and device, electronic equipment and storage medium
CN108363619B (en) Service flow control method, server, and computer-readable storage medium
US20240004652A1 (en) Methods for controlling application instance to be online or offline, electronic device, and storage medium
CN111405015B (en) Data processing method, device, equipment and storage medium
CN108446144A (en) A kind of application program launching method, device, terminal and storage medium
CN111400060A (en) Equipment linkage method, device, server and medium
CN111736825B (en) Information display method, device, equipment and storage medium
CN114201240B (en) Method and device for configuring helm chart
US11853560B2 (en) Conditional role decision based on source environments

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Room 2306, east block, Skyworth semiconductor design building, 18 Gaoxin South 4th Road, Gaoxin community, Yuehai street, Nanshan District, Shenzhen, Guangdong 518108

Applicant after: Shenzhen Kukai Network Technology Co.,Ltd.

Address before: 518108 room 1502, block a, South Skyworth building, Shennan Avenue, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen Coocaa Network Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant