CN109508912B - Service scheduling method, device, equipment and storage medium - Google Patents

Service scheduling method, device, equipment and storage medium Download PDF

Info

Publication number
CN109508912B
CN109508912B CN201811642420.4A CN201811642420A CN109508912B CN 109508912 B CN109508912 B CN 109508912B CN 201811642420 A CN201811642420 A CN 201811642420A CN 109508912 B CN109508912 B CN 109508912B
Authority
CN
China
Prior art keywords
service
machine room
order
processing
candidate
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
CN201811642420.4A
Other languages
Chinese (zh)
Other versions
CN109508912A (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.)
Guangzhou Huya Information Technology Co Ltd
Original Assignee
Guangzhou Huya Information 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 Guangzhou Huya Information Technology Co Ltd filed Critical Guangzhou Huya Information Technology Co Ltd
Priority to CN201811642420.4A priority Critical patent/CN109508912B/en
Publication of CN109508912A publication Critical patent/CN109508912A/en
Application granted granted Critical
Publication of CN109508912B publication Critical patent/CN109508912B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Educational Administration (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention discloses a service scheduling method, a device, equipment and a storage medium. The method comprises the steps of receiving a processing request of a service order; responding to the processing request, and determining the candidate machine room with the processed service order as a target machine room; dispatching the service order to the target machine room for service processing; and updating the service data aiming at the service order according to the service processing result, wherein each candidate machine room stores the service data, so that the problem of weaker risk resistance due to a single writing point is solved, the problem of larger reduction due to multiple strong consistency is also solved, the risk resistance of the service data is ensured on the premise of keeping the consistency of the service data, and the technical effect of improving the performance of service processing is achieved.

Description

Service scheduling method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a service scheduling method, a service scheduling device, service scheduling equipment and a storage medium.
Background
The system is under the operation scene of multiple places, that is, all the services of the system are distributed in two or more machine rooms for service processing, and due to the instability and delay of the network and the uncontrollable property of user access, the error of the read-write operation sequence of the data is easily caused, which brings about the problem of data consistency and further influences the whole service logic.
There are two general solutions: firstly, a single writing point mode is adopted, business data corresponding to a business are written into a computer room, data consistency can be kept, access is more efficient, but the risk resistance is weak, and when the writing point is unavailable, the whole system is unavailable; and secondly, a multi-place strong consistency scheme is adopted, wherein the multi-place strong consistency scheme is a cross-machine-room read-write separation mechanism, all write operations are directed to a host computer room for carrying out, the read operations can be executed in a secondary database of each machine room and can also be carried out by being bound to the host computer room, the consistency of data can be kept, the anti-risk capability is good, but the performance is greatly reduced, and the system bottleneck is formed.
Disclosure of Invention
The invention provides a service scheduling method, a service scheduling device, service scheduling equipment and a storage medium, which are used for ensuring the risk resistance of service data and increasing the service processing performance on the premise of keeping the consistency of the service data.
In a first aspect, an embodiment of the present invention provides a service scheduling method, where the method includes:
receiving a processing request of a business order;
responding to the processing request, and determining the candidate machine room with the processed service order as a target machine room;
dispatching the service order to the target machine room for service processing;
and updating the service data aiming at the service order according to the service processing result, wherein the service data are stored in each candidate machine room.
Further, after receiving the processing request of the service order, the method further includes:
and determining that the service order is processed for the first time according to the processing request, and taking the candidate machine room receiving the processing request as a target machine room.
Further, after determining that the service order is processed for the first time according to the processing request, and taking a candidate machine room receiving the processing request as a target machine room, the method includes:
determining a machine room code corresponding to the candidate machine room for receiving the processing request;
and generating an order identification number of the service order according to the machine room code.
Further, in response to the processing request, determining the candidate machine room in which the service order is processed as a target machine room, including:
acquiring an order identification number of the service order according to the processing request, wherein the order identification number is generated when the service order is processed for the first time;
reading a machine room code from the appointed position of the order identification number;
and determining a target machine room which processes the service order from the candidate machine rooms according to the corresponding relation between the machine room codes and the candidate machine rooms.
Further, dispatching the service order to the target machine room for service processing includes:
determining a target service type according to the service state of the service order;
and dispatching the service order to the target machine room to perform service processing corresponding to the target service type.
Further, updating the service data for the service order according to the result of the service processing includes:
updating the service data about the service order in the target machine room according to the result of service processing;
and synchronizing the service data to the candidate machine rooms except the target machine room.
Further, after determining the candidate machine room for which the service order is processed as the target machine room in response to the processing request, the method further includes:
when the target machine room fails, selecting one candidate machine room except the target machine room as a temporary machine room;
and scheduling the service order to the temporary machine room for service processing so as to update service data aiming at the service order.
In a second aspect, an embodiment of the present invention further provides a service scheduling apparatus, where the apparatus includes:
the processing request receiving module is used for receiving a processing request of a business order;
the target machine room determining module is used for responding to the processing request and determining the candidate machine room which has processed the service order as a target machine room;
the service processing module is used for dispatching the service order to the target machine room for service processing;
and the service data updating module is used for updating the service data aiming at the service order according to the result of the service processing, wherein each candidate machine room stores the service data.
In a third aspect, an embodiment of the present invention further provides a service scheduling apparatus, where the apparatus includes: a memory and one or more processors;
the memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the traffic scheduling method according to any of the first aspects.
In a fourth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the service scheduling method according to any one of the first aspect.
The embodiment of the invention receives a processing request of a business order; responding to the processing request, and determining the candidate machine room with the processed service order as a target machine room; dispatching the service order to the target machine room for service processing; and updating the service data aiming at the service orders according to the result of the service processing, wherein the service data are stored in each candidate machine room, so that on one hand, the problem of service consistency in multi-machine room deployment is solved and the correctness of service logic is ensured, unlike the scheduling of the same service order to different candidate machine rooms, the service processing is carried out by using a unique target machine room. On the other hand, unlike a single write-in point scheme, service data corresponding to a service is only written into one machine room, and also differs from a cross-machine-room read-write separation mechanism adopted in a strong-consistency scheme, in this embodiment, all candidate machine rooms store data generated by a service order, and read-write is implemented in a target machine room and is synchronized to other candidate machine rooms, so that the risk resistance of the service data is ensured on the premise of keeping the consistency of the service data, and the technical effect of increasing the performance of service processing is achieved due to the fact that time delay caused by cross-machine-room read-write of a database is avoided.
Drawings
Fig. 1A is a flowchart of a service scheduling method according to an embodiment of the present invention;
fig. 1B is a schematic diagram of a multi-machine-room deployment according to an embodiment of the present invention;
fig. 2 is a flowchart of a service scheduling method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a service scheduling apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a service scheduling device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1A is a flowchart of a service scheduling method according to an embodiment of the present invention, and fig. 1B is a schematic diagram of a multi-chassis deployment according to an embodiment of the present invention.
The embodiment can be suitable for the situation of multiple activities in different places, and the multiple activities in different places are realized by adopting a multi-machine room deployment mode, namely, two or more machine rooms are adopted to deploy services. Specifically, the service is expanded to a plurality of machine rooms, and when one machine room fails, other machine rooms can still continue normal service processing, so that the failure of the whole service system level is avoided, and the technical effects of natural expansion and high availability are realized. However, multi-room deployment can cause data consistency problems due to network instability and delay, and uncontrollable user access. Specifically, a service is generally extended to multiple machine rooms, and when the service is processed, the service is completed through cooperation of the multiple machine rooms. Furthermore, service data generated by services are also distributed in multiple machine rooms, and in the process of service processing, operations of adding, deleting and modifying the service data need to be performed across the machine rooms. It should be noted that, the instability and delay of the network and the uncontrollable access of the user may affect the sequence of the operations of adding and deleting the service data, so that the service logic may be in error. Furthermore, although a multi-ground strong consistency scheme can be adopted, the consistency of data can be kept, and the anti-risk capability is better. However, as the multiple rooms share one service database to ensure the consistency of data, the performance is greatly reduced due to network delay and time consumption of data reading and writing, which becomes a system bottleneck.
Specifically, the embodiment is suitable for dispatching the service order to the target machine room for service processing when receiving the service order, and ensures high performance of service processing and consistency and safety of service data generated by the service processing. Further, the present embodiment does not limit the application scenario, and any application scenario that determines the target machine room according to the default or historical processing condition of the service order is applicable. In this embodiment, a machine room in which a history processing situation is a processed service order will be taken as an example for explanation.
The method may be performed by a traffic scheduling apparatus. The service scheduling device is not limited in this embodiment, and the service scheduling device is a server disposed in each computer room, which may be an independent server or a cluster server.
Specifically, referring to fig. 1B, when multi-machine-room deployment is performed, a plurality of candidate machine rooms are set in the whole service system, where the candidate machine rooms are machine rooms capable of performing service processing. Furthermore, a dispatcher, a service logic module, a registration center and a database are arranged in the candidate machine room; the dispatcher is used for dispatching the service order to a target machine room for service processing; the service logic module is used for carrying out actual service processing on the scheduled service order; the registration center is provided with service logic module information of the whole service system, and the service logic module information comprises service types which can be processed by the service logic module in each candidate machine room; it should be noted that the databases in each candidate machine room store the service data generated by the service system synchronously.
Further, referring to fig. 1A, in combination with the multi-chassis deployment mode described in fig. 1B, the service scheduling method specifically includes the following steps:
and S110, receiving a processing request of the service order.
In this embodiment, the service is managed in a service order form. The lifecycle of a business order comprises: and generating order, processing the order, finishing the order and other business states. Further, the processing request is a request issued for different traffic states. If the service state of the service order is order generation, the processing request is used for requesting generation of the service order; and if the service state of the service order is processing the order, the processing request is used for requesting to process the service order. And when a service order request is received, scheduling a corresponding service logic module according to the service state to perform service processing on the service order.
It should be noted that, according to different services, the specific service states corresponding to the service orders are different.
Taking the recharging service in the live broadcast platform as an example for explanation, the service state corresponding to the service order includes generating a recharging order, processing the recharging order (classified as unpaid, failure to pay, paid and the like), and ending the recharging order (classified as canceling the order, completing the order and the like).
The above is a description of determining a service status in response to a processing request, and further, the present embodiment will describe in detail how to allocate a target machine room and a service logic module to a service order according to the processing request.
And S120, responding to the processing request, and determining the candidate machine room with the processed service order as a target machine room.
In this embodiment, the processing request is responded to perform service processing according to the service state of the service order. In this embodiment, in order to ensure data consistency, it is necessary to ensure that the same service order (in different service states in a life cycle of the service order) is all processed in the same candidate machine room, so further, in this embodiment, the candidate machine room in which the service order is processed is determined as the target machine room.
Specifically, referring to fig. 1B, a plurality of candidate machine rooms are all provided with a registry, and all service logic module information in the service system is provided in the registry. Further, after receiving a processing request of a service order, the dispatcher determines a candidate machine room in which the service order is processed as a target machine room, and further monitors information of service logic modules in a registration center, and determines a corresponding service logic module of the service order in the target machine room according to matching between the service state and the information of the service logic modules.
The embodiment does not limit how to determine the candidate machine room for processing the service order.
In an embodiment, candidate machine rooms corresponding to all service orders are stored in a database, and when a service order processing request is received, the candidate machine rooms in which the service orders are processed are searched in the database to be determined.
In an embodiment, the service order sets machine room information of the processed service order, and a target machine room can be determined in a candidate machine room according to the machine room information. The specific form of the machine room information is not limited in this embodiment, and the machine room information may be a remark set in the service order, or may be spliced in an order serial number of the service order.
S130, dispatching the service order to the target machine room for service processing.
In this embodiment, a service logic module is disposed in a target machine room, and the service order is dispatched to the service logic module of the target machine room for service processing, and the service logic module is determined according to a service state.
Specifically, referring to fig. 1B, the service order may be dispatched to the service logic module of the target machine room through a dispatcher for service processing.
In this embodiment, a service process will be described by taking a recharge service in a live broadcast platform as an example, and a user enters a service state for generating an order when sending a recharge request through a website of the live broadcast platform. Specifically, the background server of the live broadcast platform receives a processing request about order generation to generate a service order corresponding to the recharging request, and displays information of the service order to the user. Specifically, a background server of the live broadcast platform receives a service request about order processing so as to recharge a live broadcast account of the user according to a payment mode corresponding to the payment operation of the user. The business status of processing the order may further include payment status (paid, unpaid, and payment failed, etc.). And the user cancels the service order or completes the service order, then enters a service state of ending the order, and a background server of the live broadcast platform receives a service request about ending the order so as to respectively process the cancellation of the service order or the completion of the service order.
And S140, updating the service data aiming at the service order according to the service processing result, wherein the service data are stored in each candidate machine room.
In this embodiment, the service data is data generated by different service states of the service order in the life cycle. In the above recharging service, the service data may be the payment status of the order, the recharging amount, and the like.
Further, in this embodiment, the candidate machine room for receiving the processing request of the service order is the machine room, and there are two cases for updating the service data of the service order: firstly, if the local machine room is a target machine room, firstly updating the service data of the local machine room, and then updating the service data of the candidate machine rooms except the local machine room according to the updated service data; and secondly, if the local machine room is not the target machine room, updating the service data from the target machine room, and updating the service data of the candidate machine rooms except the target machine room according to the updated service data.
In order to improve the risk resistance of the business data and the performance of the business processing, the embodiment stores the business data generated by the business processing for the business order in the database in each candidate machine room. On one hand, when the database in one candidate machine room is damaged, the database in other candidate machine rooms has complete service data, so that the database can be called at any time or the service data can be recovered, and the risk resistance of the service data is improved. On the other hand, because the database in each candidate machine room has complete service data, when the target machine room performs service processing on the service order, the service data in the local database can be directly updated, so that time delay caused by reading and writing the database across the machine rooms is avoided, and the time delay comprises database reading and writing time delay and network transmission time delay.
The embodiment of the invention receives a processing request of a business order; responding to the processing request, and determining the candidate machine room with the processed service order as a target machine room; dispatching the service order to the target machine room for service processing; and updating the service data aiming at the service orders according to the result of the service processing, wherein the service data are stored in each candidate machine room, so that on one hand, the problem of service consistency in multi-machine room deployment is solved and the correctness of service logic is ensured, unlike the scheduling of the same service order to different candidate machine rooms, the service processing is carried out by using a unique target machine room. On the other hand, unlike a single write-in point scheme, service data corresponding to a service is only written into one machine room, and also differs from a cross-machine-room read-write separation mechanism adopted in a strong-consistency scheme, in this embodiment, all candidate machine rooms store data generated by a service order, and read-write is implemented in a target machine room and is synchronized to other candidate machine rooms, so that the risk resistance of the service data is ensured on the premise of keeping the consistency of the service data, and the technical effect of increasing the performance of service processing is achieved due to the fact that time delay caused by cross-machine-room read-write of a database is avoided.
Example two
Fig. 2 is a flowchart of a service scheduling method according to a second embodiment of the present invention.
In this embodiment, the service scheduling method is detailed on the basis of the above embodiment, and determines a target machine room corresponding to a service order by using an order identification number, referring to fig. 2, and specifically includes the following steps:
s210, receiving a processing request of a business order.
S220, obtaining an order identification number of the business order according to the processing request, wherein the order identification number is generated when the business order is processed for the first time.
In this embodiment, the order identification number is used to uniquely identify the service order. Specifically, the processing request carries an order identification number, which can uniquely determine the service order. Further, all the service data of the service order can be obtained by inquiring the order identification number.
It should be noted that, for the service request related to generating the order, the service order is not generated because of the first processing, and the order identification number is not carried in the service request. The present embodiment generates the order identification number when the service order is to be processed for the first time.
Further, the embodiment does not limit the specific implementation manner of the order identification number generated when the service order is processed for the first time. This embodiment will be described in detail by way of example.
Optionally, after step S210 is executed, if it is determined that the service order is processed for the first time according to the processing request, the candidate machine room receiving the processing request is taken as a target machine room, and thus the service order is bound with the target machine room. That is, the business processing is performed in the target machine room throughout the life cycle of the business order.
Further, after determining that the service order is processed for the first time according to the processing request, and taking a candidate machine room receiving the processing request as a target machine room, determining a machine room code corresponding to the candidate machine room receiving the processing request; and generating an order identification number of the service order according to the machine room code. And the candidate machine room is provided with a unique corresponding machine room code. The order identification number is generated according to the machine room code, so that the candidate machine room corresponding to the machine room code can be determined through the order identification number.
In this embodiment, how to generate the order identification number of the service order according to the machine room code is not limited, and in an embodiment, the order identification number is a concatenation of the machine room code and the service flow code, and the machine room code and the service flow code are a combination of letters and/or numbers.
In an embodiment, the order identification number is in a character splicing form, the splicing form can be flexibly customized, and the machine room code can be used as a prefix, a suffix or a infix. If the order-setting identification number generated in Shenzhen computer room is represented as: ZH-S1-000001, ZH is machine room code, S1 is service code, and 000001 is order flow code. Different services can be realized in one service system, and service codes can be used for distinguishing different services, so that service statistics and management are facilitated.
In one embodiment, the order identification number is in the form of a numerical value, and may be in the form of a numerical type of long or int. Different numerical value types and different numbers of digits of the order identification number, such as 64 digits for long and 8 digits for int. And selecting fixed continuous data positions in the order identification number to store the machine room codes. For example, a long numerical value type is used as the order identification number, the 1 st bit of the order identification number is always 0, the order identification number is guaranteed to be a positive number, the 2 nd to 4 th bits are machine room codes, and the rest 60 bits are service codes and order pipelining codes. If the machine room code 001 represents the Shenzhen machine room, the order identification number of the service order processed by the Shenzhen machine room should be 0001 … … 6846977.
And S230, reading a machine room code from the specified position of the order identification number.
In this embodiment, since the order identification number is formed by splicing a machine room code and a service flow code, the machine room code may be read from a designated position of the order identification number according to a splicing rule of the order identification number generated when the service order is processed for the first time.
Illustratively, the order identification number SZ-S1-000001 in the above embodiment is taken as an example for explanation, so SZ is machine room code, S1 is service code, and 000001 is order pipeline code.
S240, determining a target machine room for processing the service order from the candidate machine rooms according to the corresponding relation between the machine room codes and the candidate machine rooms.
In this embodiment, the candidate machine rooms correspond to the machine room codes one to one, and the machine room codes are determined, so that the candidate machine rooms can be determined. The corresponding relation can be stored in a database or a configuration file, and the database or the configuration file is read when a candidate machine room corresponding to the machine room code needs to be determined.
And S250, determining a target service type according to the service state of the service order.
In this embodiment, the life cycle of a service order includes: and generating order, processing the order, finishing the order and other business states. Of course, the specific service state corresponding to the service order is different according to different services. The method is explained by taking a recharging service in a live broadcast platform as an example, and the service state corresponding to a service order comprises the steps of generating a recharging order, processing the recharging order, finishing the recharging order and the like.
Further, since each traffic state has a different traffic type, the traffic type is a further subdivision of the traffic state. If the recharging order is processed, the recharging order is divided into service types such as unpaid, failure in payment, paid and the like; the order form for finishing recharging is divided into service types of order form canceling, order form finishing and the like. And the service type corresponding to the service state of the service order being processed is the target service type.
And S260, dispatching the service order to the target machine room so as to perform service processing corresponding to the target service type.
In this embodiment, a service logic module is disposed in a target machine room, and the service order is dispatched to the service logic module of the target machine room for service processing, and the service logic module is determined according to a service state. Specifically, referring to fig. 1B, the service order may be dispatched to the service logic module of the target machine room through a dispatcher for service processing.
S270, updating the service data about the service order in the target machine room according to the service processing result.
In this embodiment, the service data is data generated by different service states of the service order in the life cycle. In the above recharging service, the service data may be the payment status of the order, the recharging amount, and the like. And when the target machine room carries out service processing on the service order, updating the generated service data into the database of the target machine room in real time.
S280, synchronizing the service data to the candidate machine rooms except the target machine room.
In this embodiment, referring to fig. 1B, when the target machine room processes a service order, the generated service data is updated to the database of the target machine room in real time, and when the target machine room completes processing the service order, the service data in the target machine room is synchronously updated to the candidate machine rooms except the target machine room. By updating the service data related to the service order in the target machine room, the read-write operation of the service data can be ensured to be carried out in the target machine room, the time delay caused by reading and writing the database across machine rooms is avoided, the real-time performance of service order processing is ensured, and the waiting time of a user is saved. And then, synchronizing the service data updated by the target machine room to the candidate machine rooms except the target machine room, so as to increase the risk resistance of the service data.
Specifically, in an embodiment, when the target machine room fails, one candidate machine room other than the target machine room is selected as a temporary machine room; and scheduling the service orders to the temporary machine room for service processing so as to update service data aiming at the service orders, so that when the database in one candidate machine room is damaged, the database in other candidate machine rooms can be called at any time or the service data can be recovered because the databases in other candidate machine rooms also have complete service data, and the risk resistance of the service data is improved.
According to the technical scheme of the embodiment, a processing request of a business order is received; acquiring an order identification number of the service order according to the processing request, wherein the order identification number is generated when the service order is processed for the first time; reading a machine room code from the appointed position of the order identification number; determining a target machine room which processes the service order from the candidate machine rooms according to the corresponding relation between the machine room codes and the candidate machine rooms; determining a target service type according to the service state of the service order; dispatching the service order to the target machine room to perform service processing corresponding to the target service type; updating the service data about the service order in the target machine room according to the result of service processing; and synchronizing the service data to the candidate machine rooms except the target machine room, so that on one hand, the service processing is carried out by determining the unique target machine room according to the order number instead of scheduling the same service order to different candidate machine rooms, the service consistency problem in multi-machine-room deployment is solved, and the correctness of service logic is ensured. On the other hand, unlike a single write-in point scheme, service data corresponding to a service is only written into one machine room, and also differs from a cross-machine-room read-write separation mechanism adopted in a strong-consistency scheme, in this embodiment, all candidate machine rooms store data generated by a service order, and read-write is implemented in a target machine room and is synchronized to other candidate machine rooms, so that the risk resistance of the service data is ensured on the premise of keeping the consistency of the service data, and the technical effect of increasing the performance of service processing is achieved due to the fact that time delay caused by cross-machine-room read-write of a database is avoided. Furthermore, the order identification number is the splicing of the machine room code and the service flow code, the target machine room can be determined according to the order identification number, the effect of simplicity in implementation is achieved, the speed of determining the target machine room is increased, and therefore the response speed of processing the service order is increased.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a service scheduling apparatus according to a third embodiment of the present invention.
The embodiment is suitable for the situation of multiple activities in different places, the multiple activities in different places are realized by adopting a multi-machine-room deployment mode, specifically, the service is expanded to multiple machine rooms, when one machine room fails, other machine rooms can still continue normal service processing, so that the failure of the whole service system level is avoided, and the technical effects of natural expansion and high availability are realized. However, multi-room deployment can cause data consistency problems due to network instability and delay, and uncontrollable user access. Specifically, the service is extended to multiple machine rooms, and when the service is processed, the service can be completed only by cooperation of the multiple machine rooms. Furthermore, service data generated by services are also distributed in multiple machine rooms, and in the process of service processing, operations of adding, deleting and modifying the service data need to be performed across the machine rooms. It should be noted that, the instability and delay of the network and the uncontrollable access of the user may affect the sequence of the operations of adding and deleting the service data, so that the service logic may be in error. Furthermore, although a multi-ground strong consistency scheme can be adopted, the consistency of data can be kept, and the anti-risk capability is better. However, as the multiple computer rooms share one service data storage to ensure the consistency of data, the performance is greatly reduced due to network delay and time consumption of data reading and writing, which becomes a system bottleneck.
Specifically, the embodiment is suitable for dispatching the service order to the target machine room for service processing when receiving the service order, and ensures high performance of service processing and consistency and safety of service data generated by the service processing. Further, the present embodiment does not limit the application scenario, and any application scenario for determining the target machine room according to the historical processing condition of the service order can be applied. In this embodiment, a machine room in which a history processing situation is a processed service order will be taken as an example for explanation.
The apparatus may be integrated in a traffic scheduling device. The service scheduling device is not limited in this embodiment, and the service scheduling device is a server disposed in each machine room in this embodiment, which is described in detail, where the server may be an independent server or a cluster server, and may be an entity server or a cloud server.
Specifically, referring to fig. 1B, when multi-machine-room deployment is performed, a plurality of candidate machine rooms are set in the whole service system, where the candidate machine rooms are machine rooms capable of performing service processing. Furthermore, a dispatcher, a service logic module, a registration center and a database are arranged in the candidate machine room; the dispatcher is used for dispatching the service order to a target machine room for service processing; the service logic module is used for carrying out actual service processing on the scheduled service order; the registration center is provided with service logic module information of the whole service system, and the service logic module information comprises service types which can be processed by the service logic module in each candidate machine room; it should be noted that the databases in each candidate machine room store the service data generated by the service system synchronously.
Further, referring to fig. 3, in combination with the multi-chassis deployment mode described in fig. 1B, the service scheduling apparatus specifically includes the following structure: a processing request receiving module 310, a target machine room determining module 320, a business processing module 330 and a business data updating module 340.
A processing request receiving module 310, configured to receive a processing request of a service order.
And a target machine room determining module 320, configured to determine, in response to the processing request, a candidate machine room in which the service order is processed as a target machine room.
And the service processing module 330 is configured to schedule the service order to the target machine room for service processing.
A service data updating module 340, configured to update the service data for the service order according to the result of the service processing, where each candidate machine room stores the service data.
The embodiment of the invention receives a processing request of a business order; responding to the processing request, and determining the candidate machine room with the processed service order as a target machine room; dispatching the service order to the target machine room for service processing; and updating the service data aiming at the service orders according to the result of the service processing, wherein the service data are stored in each candidate machine room, so that on one hand, the problem of service consistency in multi-machine room deployment is solved and the correctness of service logic is ensured, unlike the scheduling of the same service order to different candidate machine rooms, the service processing is carried out by using a unique target machine room. On the other hand, unlike a single write-in point scheme, service data corresponding to a service is only written into one machine room, and also differs from a cross-machine-room read-write separation mechanism adopted in a strong-consistency scheme, in this embodiment, all candidate machine rooms store data generated by a service order, and read-write is implemented in a target machine room and is synchronized to other candidate machine rooms, so that the risk resistance of the service data is ensured on the premise of keeping the consistency of the service data, and the technical effect of increasing the performance of service processing is achieved due to the fact that time delay caused by cross-machine-room read-write of a database is avoided.
On the basis of the above embodiment, the apparatus further includes:
and the first-time processing module is used for determining that the service order is processed for the first time according to the processing request, and then taking the candidate machine room receiving the processing request as a target machine room.
On the basis of the above embodiment, the apparatus further includes:
and the machine room code determining module is used for determining the machine room code corresponding to the candidate machine room for receiving the processing request after determining that the service order is processed for the first time according to the processing request and taking the candidate machine room for receiving the processing request as a target machine room.
And the order identification number generating module is used for generating the order identification number of the service order according to the machine room code.
On the basis of the above embodiment, the target machine room determining module 320 includes:
and the order identification number acquisition unit is used for acquiring the order identification number of the service order according to the processing request, and the order identification number is generated when the service order is processed for the first time.
And the machine room code reading unit is used for reading the machine room code from the specified position of the order identification number.
And the target machine room determining unit is used for determining the target machine room which processes the service order from the candidate machine rooms according to the corresponding relation between the machine room codes and the candidate machine rooms.
On the basis of the above embodiment, the service processing module 330 includes:
and the target service type determining unit is used for determining the target service type according to the service state of the service order.
And the service order scheduling unit is used for scheduling the service order to the target machine room so as to perform service processing corresponding to the target service type.
On the basis of the foregoing embodiment, the service data updating module 340 includes:
and the service data updating unit is used for updating the service data related to the service order in the target machine room according to the result of service processing.
And the synchronization unit is used for synchronizing the service data to the candidate machine rooms except the target machine room.
On the basis of the above embodiment, the apparatus further includes:
and the temporary machine room selecting module is used for selecting one candidate machine room except the target machine room as a temporary machine room when the target machine room fails after responding to the processing request and determining the candidate machine room which has processed the service order as the target machine room.
And the temporary service processing unit is used for dispatching the service order to the temporary machine room for service processing so as to update the service data aiming at the service order.
The product can execute the method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of a service scheduling device according to a fourth embodiment of the present invention. As shown in fig. 4, the service scheduling apparatus includes: a processor 40, a memory 41, an input device 42, and an output device 43. The number of the processors 40 in the service scheduling device may be one or more, and one processor 40 is taken as an example in fig. 4. The number of the memory 41 in the service scheduling device may be one or more, and one memory 41 is taken as an example in fig. 4. The processor 40, the memory 41, the input device 42 and the output device 43 of the service scheduling apparatus may be connected by a bus or other means, and fig. 4 illustrates the connection by the bus as an example. The service scheduling device can be a computer, a server and the like. In this embodiment, the service scheduling device is taken as a server for detailed description, and the server may be an independent server or a cluster server.
The memory 41 is used as a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the service scheduling method according to any embodiment of the present invention (for example, the processing request receiving module 310, the target machine room determining module 320, the service processing module 330, and the service data updating module 340 in the service scheduling apparatus). The memory 41 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the device, and the like. Further, the memory 41 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 41 may further include memory located remotely from processor 40, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 42 may be used for receiving input numeric or character information and generating key signal inputs related to user settings and function control of the service scheduling apparatus, and may be a camera for acquiring images and a sound pickup apparatus for acquiring audio data. The output means 43 may comprise an audio device such as a speaker. It should be noted that the specific composition of the input device 42 and the output device 43 can be set according to actual conditions.
The processor 40 executes various functional applications of the device and data processing by running software programs, instructions and modules stored in the memory 41, that is, implements the service scheduling method described above.
EXAMPLE five
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are executed by a computer processor to perform a service scheduling method, and the method includes:
receiving a processing request of a business order;
responding to the processing request, and determining the candidate machine room with the processed service order as a target machine room;
dispatching the service order to the target machine room for service processing;
and updating the service data aiming at the service order according to the service processing result, wherein the service data are stored in each candidate machine room.
Of course, the storage medium containing the computer-executable instructions provided in the embodiments of the present invention is not limited to the operation of the service scheduling method described above, and may also perform related operations in the service scheduling method provided in any embodiment of the present invention, and has corresponding functions and advantages.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions to enable a computer device (which may be a robot, a personal computer, a server, or a network device) to execute the service scheduling method according to any embodiment of the present invention.
It should be noted that, in the service scheduling apparatus, each unit and each module included in the service scheduling apparatus are only divided according to functional logic, but are not limited to the above division as long as the corresponding function can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A method for scheduling traffic, comprising:
receiving a processing request of a business order;
responding to the processing request, and determining the candidate machine room with the processed service order as a target machine room;
dispatching the service order to the target machine room for service processing;
updating service data aiming at the service order according to the result of the service processing, wherein the service data are stored in each candidate machine room;
wherein, responding to the processing request, determining the candidate machine room with the processed service order as a target machine room, comprises:
acquiring an order identification number of the service order according to the processing request, wherein the order identification number is generated according to a machine room code of a machine room for processing the service order for the first time when the service order is processed for the first time;
reading a machine room code from the appointed position of the order identification number;
and determining a target machine room which processes the service order from the candidate machine rooms according to the corresponding relation between the machine room codes and the candidate machine rooms.
2. The method of claim 1, after receiving a request for processing of a business order, further comprising:
and determining that the service order is processed for the first time according to the processing request, and taking the candidate machine room receiving the processing request as a target machine room.
3. The method according to claim 2, wherein after determining that the service order is processed for the first time according to the processing request, and taking a candidate machine room receiving the processing request as a target machine room, the method comprises:
determining a machine room code corresponding to the candidate machine room for receiving the processing request;
and generating an order identification number of the service order according to the machine room code.
4. The method of claim 1, wherein dispatching the service order to the target machine room for service processing comprises:
determining a target service type according to the service state of the service order;
and dispatching the service order to the target machine room to perform service processing corresponding to the target service type.
5. The method of claim 1, wherein updating the business data for the business order according to the result of the business process comprises:
updating the service data about the service order in the target machine room according to the result of service processing;
and synchronizing the service data to the candidate machine rooms except the target machine room.
6. The method of any of claims 1-5, wherein after determining the candidate room for which the service order was processed as the target room in response to the processing request, further comprising:
when the target machine room fails, selecting one candidate machine room except the target machine room as a temporary machine room;
and scheduling the service order to the temporary machine room for service processing so as to update service data aiming at the service order.
7. A traffic scheduling apparatus, comprising:
the processing request receiving module is used for receiving a processing request of a business order;
the target machine room determining module is used for responding to the processing request and determining the candidate machine room which has processed the service order as a target machine room;
the service processing module is used for dispatching the service order to the target machine room for service processing;
a service data updating module, configured to update service data for the service order according to the result of the service processing, where each candidate machine room stores the service data;
wherein the target machine room determining module comprises:
the order identification number acquisition unit is used for acquiring the order identification number of the service order according to the processing request, wherein the order identification number is generated according to the machine room code of the machine room for processing the service order for the first time when the service order is processed for the first time;
the computer room code reading unit is used for reading a computer room code from the specified position of the order identification number;
and the target machine room determining unit is used for determining the target machine room which processes the service order from the candidate machine rooms according to the corresponding relation between the machine room codes and the candidate machine rooms.
8. A traffic scheduling apparatus, comprising: a memory and one or more processors;
the memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the traffic scheduling method of any of claims 1-6.
9. A storage medium containing computer executable instructions for performing the traffic scheduling method of any of claims 1-6 when executed by a computer processor.
CN201811642420.4A 2018-12-29 2018-12-29 Service scheduling method, device, equipment and storage medium Active CN109508912B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811642420.4A CN109508912B (en) 2018-12-29 2018-12-29 Service scheduling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811642420.4A CN109508912B (en) 2018-12-29 2018-12-29 Service scheduling method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109508912A CN109508912A (en) 2019-03-22
CN109508912B true CN109508912B (en) 2021-05-28

Family

ID=65757017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811642420.4A Active CN109508912B (en) 2018-12-29 2018-12-29 Service scheduling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109508912B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110266747B (en) * 2019-04-12 2022-04-08 创新先进技术有限公司 Method and device for switching machine room of service request
CN112785300A (en) * 2019-11-11 2021-05-11 网联清算有限公司 Transaction request processing method and device, electronic equipment and medium
CN111447143B (en) * 2020-03-31 2022-10-04 苏宁云计算有限公司 Business service data transmission method and device, computer equipment and storage medium
CN111930570A (en) * 2020-08-17 2020-11-13 湖南快乐阳光互动娱乐传媒有限公司 Processing system and processing method for high availability of multi-computer-room database

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107635010A (en) * 2017-10-13 2018-01-26 网易(杭州)网络有限公司 Traffic scheduling method, device, computer-readable recording medium and electronic equipment
CN108062705A (en) * 2017-12-26 2018-05-22 北京京东金融科技控股有限公司 Information interacting method and device, system, electronic equipment, storage medium
CN109104490A (en) * 2018-08-29 2018-12-28 北京达佳互联信息技术有限公司 Service identification management method, device, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103595570B (en) * 2013-11-20 2017-11-10 中国农业银行股份有限公司广东省分行 A kind of more framework front-end system, server and method for processing business living
CN105162879B (en) * 2015-09-24 2019-03-12 北京奇虎科技有限公司 Realize the method, apparatus and system of multimachine room data consistency
US20170185943A1 (en) * 2015-12-28 2017-06-29 Sap Se Data analysis for predictive scheduling optimization for product production

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107635010A (en) * 2017-10-13 2018-01-26 网易(杭州)网络有限公司 Traffic scheduling method, device, computer-readable recording medium and electronic equipment
CN108062705A (en) * 2017-12-26 2018-05-22 北京京东金融科技控股有限公司 Information interacting method and device, system, electronic equipment, storage medium
CN109104490A (en) * 2018-08-29 2018-12-28 北京达佳互联信息技术有限公司 Service identification management method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109508912A (en) 2019-03-22

Similar Documents

Publication Publication Date Title
CN109508912B (en) Service scheduling method, device, equipment and storage medium
CN108920135B (en) User-defined service generation method and device, computer equipment and storage medium
CN109886693B (en) Consensus realization method, device, equipment and medium for block chain system
CN111399764B (en) Data storage method, data reading device, data storage equipment and data storage medium
CN112766646B (en) Method, device, equipment and storage medium for generating and processing task flow
CN109634764A (en) Work-flow control method, apparatus, equipment, storage medium and system
CN111767144A (en) Transaction routing determination method, device, equipment and system for transaction data
CN110990415A (en) Data processing method and device, electronic equipment and storage medium
CN108390914B (en) Service updating method, device and system
CN107220375B (en) Data reading and writing method and server
CN106708842A (en) Data loading method for application system, database and application system
CN109743202B (en) Data management method, device and equipment and readable storage medium
CN111144837A (en) Flow arrangement method and device, storage medium and electronic equipment
CN108536447B (en) Operation and maintenance management method
CN114490062A (en) Local disk scheduling method and device, electronic equipment and storage medium
CN112837155A (en) Method and device for registering and executing intelligent contracts in block chain
CN111679919A (en) Data interaction method, device, equipment and storage medium
CN108829798B (en) Data storage method and system based on distributed database
EP4109366A1 (en) Method and device for managing project by using data merging
CN114844788B (en) Network data analysis method, system, equipment and storage medium
CN112764897B (en) Task request processing method, device and system and computer readable storage medium
CN111080250B (en) Flow backspacing compensation method and device, storage medium and electronic equipment
CN110290215B (en) Signal transmission method and device
CN112416980A (en) Data service processing method, device and equipment
CN104394195A (en) Data updating method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20190322

Assignee: GUANGZHOU HUYA TECHNOLOGY Co.,Ltd.

Assignor: GUANGZHOU HUYA INFORMATION TECHNOLOGY Co.,Ltd.

Contract record no.: X2021990000339

Denomination of invention: Service scheduling method, device, device and storage medium

Granted publication date: 20210528

License type: Common License

Record date: 20210607

EE01 Entry into force of recordation of patent licensing contract