Business processing method, system and device, electronic equipment and storage medium
Through the business processing method of the master-slave controller architecture, the master controller generates and synchronizes device control instructions, and actively acquires the service execution device, thereby improving the control management efficiency in large-scale business scenarios and solving the problem of inefficiency in traditional methods.
Patent Information
- Application Number
- CN202410080972.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-19
- Publication Date
- 2025-07-22
AI Technical Summary
Traditional business processing methods cannot effectively manage massive business execution equipment, resulting in inefficient control management.
Adopting the master-slave controller architecture, the master controller generates device control instructions and synchronizes them to multiple slave controllers. The service execution device actively obtains instructions from slave controllers to avoid single point of failure and reduces the pressure on the service controller.
It improves business processing efficiency, reduces the resource overhead of the business controller, and meets the management needs of large-scale business scenarios.
Smart Images

Figure CN120358123A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology and may involve fields such as business processing and cloud technology. Specifically, this application relates to a business processing method, system, device, electronic device, and storage medium. Background Art
[0002] With the rapid development of cloud computing technology, various cloud products emerge in an endless stream. Among them, based on different provided business services, they can be divided into cloud management products, cloud storage products, cloud communication products, and so on.
[0003] In related cloud products, users can send business information through a control terminal. After receiving the business information, the business controller can generate corresponding device control instructions based on the business information arrangement and send them to each business execution device respectively to control each business execution device to execute the instructions to implement the business services corresponding to the cloud products.
[0004] However, in large-scale business scenarios, in the face of a huge number of business execution devices, traditional business processing methods can no longer meet the management needs of a large number of devices. How to control and manage a large number of business execution devices has become an urgent problem to be solved. Summary of the Invention
[0005] The purpose of the embodiments of this application is to provide a business processing method, system, device, electronic device, and storage medium that can effectively improve business processing efficiency.
[0006] On the one hand, the embodiments of this application provide a business processing method. The method is applied to a business processing system. The system includes a plurality of business controllers and a plurality of business execution devices. The plurality of business controllers include a main controller and a plurality of slave controllers;
[0007] The method is executed by a first controller, and the first controller is any one of the slave controllers. The method includes:
[0008] Obtain and store a first instruction set from the main controller; the first instruction set includes at least one device control instruction, and the device control instruction is generated by the main controller based on the received business to be processed;
[0009] Receive a first instruction acquisition request sent by a first execution device; wherein, the first execution device is any one of the business execution devices, and the first instruction acquisition request includes a first identifier, and the first identifier is used to represent the device control instruction that the first execution device has obtained;
[0010] Determine a third instruction set from the second instruction set according to the first identifier, and send the third instruction set to the first execution device for execution; wherein, the second instruction set includes device control instructions corresponding to the first execution device stored in the first controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by the first execution device.
[0011] On the other hand, an embodiment of the present application further provides a service processing device, which is deployed in the first controller of a service processing system; the system includes a plurality of service controllers and a plurality of service execution devices, the plurality of service controllers include a main controller and a plurality of slave controllers, and the first controller is any one of the slave controllers;
[0012] The device includes:
[0013] An instruction acquisition module, configured to acquire and store a first instruction set from the main controller; the first instruction set includes at least one device control instruction, and the device control instruction is generated by the main controller based on the received service to be processed;
[0014] A request receiving module, configured to receive a first instruction acquisition request sent by a first execution device; wherein, the first execution device is any one of the service execution devices, and the first instruction acquisition request includes a first identifier, and the first identifier is used to represent the device control instructions that have been acquired by the first execution device;
[0015] An instruction sending module, configured to determine a third instruction set from the second instruction set according to the first identifier, and send the third instruction set to the first execution device for execution; wherein, the second instruction set includes device control instructions corresponding to the first execution device stored in the first controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by the first execution device.
[0016] Optionally, the instruction acquisition module may be configured to:
[0017] Send a second instruction acquisition request to the main controller, where the second instruction acquisition request includes a second identifier, and the second identifier is used to represent the device control instructions that have been acquired by the first controller;
[0018] Receive the first instruction set sent by the main controller based on the second identifier; wherein, the first instruction set includes device control instructions generated by the main controller that have not been acquired by the first controller.
[0019] Optionally, the system further includes a load balancing server;
[0020] The request receiving module may be configured to:
[0021] Receive a first instruction acquisition request sent by the first execution device through the load balancing server;
[0022] Wherein, the first controller is a target slave controller determined by the load balancing server in the following manner:
[0023] Obtain a set of candidate controllers; the set of candidate controllers includes at least one slave controller determined from each of the slave controllers based on the status of each slave controller, and the status of a slave controller indicates whether the controller is abnormal;
[0024] Determine a target slave controller according to the load information of each slave controller in the set of candidate controllers.
[0025] Optionally, the set of candidate controllers is received from the master controller;
[0026] Wherein, the set of candidate controllers is determined by the master controller in the following manner:
[0027] Determine the status of each slave controller according to the device control instructions that each slave controller has obtained from the master controller;
[0028] Determine each slave controller with normal status as the set of candidate controllers.
[0029] Optionally, the status of each slave controller is determined by the master controller in the following manner:
[0030] Determine the status of each slave controller according to the second identifier in the second instruction acquisition request received most recently from each slave controller.
[0031] Optionally, the first instruction set includes at least one device control instruction and the instruction identifier of each instruction in the at least one device control instruction, wherein the instruction identifier of a device control instruction is related to the generation time of the device control instruction;
[0032] The status of each slave controller is determined by the master controller in the following manner:
[0033] For each slave controller, determine the difference between the second identifier corresponding to the slave controller and the instruction identifier of the device control instructions generated in the master controller; wherein, the second identifier corresponding to a slave controller is: the instruction identifier of the device control instruction with the latest generation time among the device control instructions obtained by the slave controller; the difference represents the number of device control instructions generated in the master controller that have not been obtained by the slave controller;
[0034] For each of the slave controllers, if the difference corresponding to the slave controller is greater than or equal to the first threshold, determine that the status of the slave controller is abnormal; if the difference corresponding to the slave controller is less than the first threshold, determine that the status of the slave controller is normal.
[0035] Optionally, the service processing device further includes a controller update module;
[0036] When the master controller fails as the original master controller and the first controller is determined to be the new master controller, the controller update module can be used for:
[0037] Based on the device control instructions stored in the first controller, obtain a first instruction to be synchronized from other slave controllers; the other slave controllers are the slave controllers other than the first controller among the multiple slave controllers, where the first instruction to be synchronized refers to the device control instructions that the other slave controllers have obtained from the original master controller and the first controller has not obtained.
[0038] Optionally, the controller update module can be used for:
[0039] Send a synchronization pre-query request to each of the other slave controllers respectively;
[0040] Receive the respective third identifiers sent by each of the other slave controllers in response to the synchronization pre-query request; the third identifier corresponding to each other slave controller is used to represent the device control instructions obtained by the other slave controller.
[0041] Determine a synchronization controller from each of the other slave controllers according to the third identifiers corresponding to each of the other slave controllers;
[0042] Send a synchronization instruction acquisition request to the synchronization controller, where the synchronization instruction acquisition request carries the third identifier corresponding to the first controller;
[0043] Receive the set of instructions to be synchronized sent by the synchronization controller in response to the synchronization instruction acquisition request, and the set of instructions to be synchronized includes at least one device control instruction.
[0044] Optionally, when the original master controller resumes normal operation, the controller update module is further used for:
[0045] Receive and store the second instruction to be synchronized sent by the original master controller, where the second instruction to be synchronized is the device control instruction that the original master controller has generated but has not been obtained by any slave controller;
[0046] Send the second instruction to be synchronized to each of the other slave controllers.
[0047] On the other hand, an embodiment of the present application further provides a service processing method, which is applied to a service processing system. The system includes a plurality of service controllers and a plurality of service execution devices. The plurality of service controllers include a main controller and a plurality of slave controllers;
[0048] The method is executed by the main controller, and the method includes:
[0049] Obtain the service to be processed and generate a device control instruction corresponding to the service to be processed;
[0050] Send a first instruction set to each of the slave controllers, where the first instruction set includes at least one device control instruction; so that any slave controller performs the following operations:
[0051] Receive a first instruction acquisition request sent by a first execution device; where the first execution device is any service execution device, and the first instruction acquisition request includes a first identifier, and the first identifier is used to represent the device control instruction that the first execution device has acquired;
[0052] Determine a third instruction set from a second instruction set according to the first identifier, and send the third instruction set to the first execution device for execution; where the second instruction set includes the device control instructions corresponding to the first execution device stored in any slave controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by the first execution device.
[0053] On the other hand, an embodiment of the present application further provides a service processing device, which is deployed in the main controller of the service processing system; the system includes a plurality of service controllers and a plurality of service execution devices. The plurality of service controllers include a main controller and a plurality of slave controllers;
[0054] The device includes:
[0055] An instruction generation module, configured to obtain the service to be processed and generate a device control instruction corresponding to the service to be processed;
[0056] An instruction distribution module, configured to send a first instruction set to each of the slave controllers, where the first instruction set includes at least one device control instruction; so that any slave controller performs the following operations:
[0057] Receive a first instruction acquisition request sent by a first execution device; where the first execution device is any service execution device, and the first instruction acquisition request includes a first identifier, and the first identifier is used to represent the device control instruction that the first execution device has acquired;
[0058] Determine a third instruction set from the second instruction set according to the first identifier, and send the third instruction set to the first execution device for execution; wherein, the second instruction set includes device control instructions corresponding to the first execution device stored in any one of the slave controllers, and the third instruction set includes at least one device control instruction in the second instruction set that has not been obtained by the first execution device.
[0059] On the other hand, an embodiment of the present application further provides a service processing system, which includes a plurality of service controllers and a plurality of service execution devices, and the plurality of service controllers include a main controller and a plurality of slave controllers;
[0060] Wherein:
[0061] The main controller is configured to obtain a service to be processed and generate device control instructions corresponding to the service to be processed; send a first instruction set to each of the slave controllers, where the first instruction set includes at least one device control instruction;
[0062] Any one of the slave controllers is configured to receive and store the first instruction set sent by the main controller; receive a first instruction acquisition request sent by any one of the service execution devices; wherein, the first instruction acquisition request includes a first identifier, and the first identifier is used to represent the device control instructions that have been obtained by any one of the service execution devices; determine a third instruction set from the second instruction set according to the first identifier, and send the third instruction set to any one of the service execution devices; wherein, the second instruction set includes device control instructions corresponding to any one of the service execution devices stored in any one of the slave controllers, and the third instruction set includes at least one device control instruction in the second instruction set that has not been obtained by any one of the service execution devices;
[0063] Any one of the service execution devices is configured to send a first instruction acquisition request to any one of the slave controllers; receive and execute the device control instructions in the third instruction set sent by any one of the slave controllers
[0064] An embodiment of the present application further provides an electronic device, which includes a memory and a processor. A computer program is stored in the memory, and the processor executes the computer program to implement the method provided in any optional embodiment of the present application.
[0065] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the method provided in any optional embodiment of the present application is implemented.
[0066] On the other hand, an embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the method provided in any optional embodiment of the present application.
[0067] The beneficial effects brought by the technical solutions provided in the embodiments of the present application are as follows:
[0068] In the solution provided in the embodiment of the present application, the service processing system includes multiple service controllers including a main controller and multiple slave controllers, realizing the clustered deployment of the service controllers. In this solution, the main controller generates corresponding device control instructions based on the received service to be processed and synchronizes the device control instructions to multiple slave controllers. The service execution device can obtain the instructions from any slave controller and execute them. Adopting this solution can avoid single-point failures, and by adopting the method that each service execution device actively obtains instructions from the service controller, the service controller does not need to actively manage the status of each service execution device, which can reduce the pressure on the service controller and reduce the resource overhead of the service controller, thereby effectively improving the service processing efficiency and better meeting the actual application requirements. Description of the Drawings
[0069] Figure 1 It is a schematic flowchart of a service processing method provided by an embodiment of the present application;
[0070] Figure 2 It is a schematic structural diagram of a service processing system provided by an embodiment of the present application;
[0071] Figure 3 It is a schematic diagram of instruction synchronization between the master and slave controllers provided by an embodiment of the present application;
[0072] Figure 4 It is a schematic structural diagram of a service processing system provided by an embodiment of the present application;
[0073] Figure 5a It is a schematic diagram of instruction synchronization when the original master controller is normal provided by an embodiment of the present application;
[0074] Figure 5b It is a schematic diagram of instruction synchronization after the original master controller fails provided by an embodiment of the present application;
[0075] Figure 6 It is a schematic flowchart of a service processing method provided by an embodiment of the present application;
[0076] Figure 7 It is a schematic structural diagram of a service processing device provided by an embodiment of the present application;
[0077] Figure 8 It is a schematic structural diagram of a service processing device provided by an embodiment of the present application;
[0078] Figure 9 A schematic structural diagram of an electronic device provided by an embodiment of the present application. Specific embodiments
[0079] The embodiments of the present application will be described below with reference to the accompanying drawings in the present application. It should be understood that the embodiments described below in conjunction with the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0080] Those skilled in the art of the present technology can understand that unless specifically stated otherwise, the singular forms "a", "an", "the" and "said" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation of other features, information, data, steps, operations, elements, components and / or their combinations supported by the art of the present technology. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used here can include wireless connection or wireless coupling. The term "and / or" used here indicates at least one of the items defined by the term. For example, "A and / or B" can be implemented as "A", or implemented as "B", or implemented as "A and B". When describing multiple (two or more) items, if the relationship between the multiple items is not clearly defined, the multiple items can refer to one, more or all of the multiple items. For example, for the description of "parameter A includes A1, A2, A3", it can be implemented that parameter A includes A1 or A2 or A3, and it can also be implemented that parameter A includes at least two of the three items of parameter A1, A2, A3.
[0081] The embodiments of the present application provide a service processing method, system, device, electronic device and storage medium. The service processing system includes multiple service controllers including a main controller and multiple slave controllers, realizing the clustered deployment of service controllers. In this solution, the main controller generates corresponding device control instructions based on the received service to be processed, and synchronizes the device control instructions to multiple slave controllers. The service execution device can obtain the instructions from any slave controller and execute them. Adopting this solution can avoid single-point failures, and by adopting the method that each service execution device actively obtains instructions from the service controller, the service controller does not need to actively manage whether the status of each service execution device is abnormal, which can reduce the pressure on the service controller and reduce the resource overhead of the service controller, thereby effectively improving the service processing efficiency.
[0082] Optionally, the solution provided by the embodiments of the present application may involve cloud technology. For example, the solution of the embodiments of the present application may be executed by a server or a user terminal. Among them, the server may be a cloud server, and the data processing involved in the implementation process of the solution may be realized based on cloud technology, and the data storage involved in the implementation process may adopt cloud storage. For example, generating a device control instruction corresponding to a service to be processed may be realized by using cloud technology, and the device control instruction may be stored in a cloud server.
[0083] Among them, cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computing devices, enabling various application systems to obtain computing power, storage space, and information services as needed. The network that provides resources is called the "cloud". The resources in the "cloud" seem to be infinitely expandable to users, and can be obtained at any time, used on demand, expanded at any time, and paid according to usage.
[0084] As a basic capability provider of cloud computing (i.e., a cloud vendor), a cloud computing resource pool (referred to as a cloud platform, generally called an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to select and use. The cloud computing resource pool mainly includes: computing devices (virtual machines containing operating systems), storage devices, and network devices.
[0085] According to the logical function division, a PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and a SaaS (Software as a Service) layer can be deployed on top of the PaaS layer. Alternatively, the SaaS can be directly deployed on the IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is various business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0086] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, be used on demand, and is flexible and convenient. Cloud computing technology will become an important support. Cloud storage is a new concept extended and developed from the cloud computing concept. A distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that combines a large number of different types of storage devices (storage devices are also called storage nodes) in the network through cluster applications, grid technology, and distributed file systems, and works together through application software or application interfaces to provide data storage and business access functions externally.
[0087] Cloud products refer to cloud computing products that provide cloud services. There are a wide variety of cloud computing products, which are widely involved in various fields such as transportation, healthcare, and energy. Different products have different characteristics and application scenarios. For example, cloud management products are used to manage and deploy cloud computing resources to achieve unified management of cloud resources; cloud storage products provide storage services based on the cloud computing platform, capable of providing massive storage space and high access speed; cloud security products are involved in protecting the network security of the cloud computing environment and providing powerful security protection functions; cloud communication products provide communication services based on the cloud computing platform, realize data transmission, and provide a more convenient and efficient communication method.
[0088] It should be noted that in the optional embodiments of this application, for relevant data such as object information (e.g., the service data transmitted by the cloud dedicated line), when the embodiments in this application are applied to specific products or technologies, object permission or consent is required, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions. That is to say, if the embodiments in this application involve data related to an object, it needs to be obtained under the authorization and consent of the object, the authorization and consent of relevant departments, and compliance with the relevant laws, regulations, and standards of the country and region. In the embodiments, if personal information is involved, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject is required, and the embodiments also need to be implemented under the authorization and consent of the object.
[0089] The embodiments of this application provide a service processing method. This service processing method can be applied to a service processing system, which may include: a plurality of service controllers and a plurality of service execution devices. The plurality of service controllers include a main controller and a plurality of slave controllers. This service processing method can be described with any device in the service processing system as the execution subject.
[0090] Among them, the above service controller may be a service server that provides service, for example, a service server that provides virtual private line service. The service controller may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing service (which can be referred to as the cloud). The above service execution device may be an electronic device required to implement the service, such as a terminal device, a network device, etc. The network device may include devices such as routers, gateways, switches, etc., and the terminal device may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart voice interaction device (such as a smart speaker), a wearable electronic device (such as a smart watch), a vehicle-mounted terminal, a smart home appliance (such as a smart TV), an AR / VR device, etc., but is not limited thereto. The main controller and each slave controller, and each slave controller and the service execution device may be communicatively connected directly or indirectly in a wired or wireless manner.
[0091] Next, through the description of several embodiments, the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application will be described. It should be noted that the following embodiments may refer to, draw on or combine with each other. For the same terms, similar features and similar implementation steps in different embodiments, they will not be described repeatedly.
[0092] Figure 1 The flowchart of a service processing method provided by an embodiment of the present application is shown. The service processing method may be executed by a first controller in a service processing system.
[0093] As Figure 1 shown, the service processing method provided by an embodiment of the present application may include the following S110 to S130.
[0094] S110: Obtain and store a first instruction set from the main controller.
[0095] Among them, the first instruction set includes at least one device control instruction, and the device control instruction is generated by the main controller based on the received service to be processed. The present application does not limit the instruction content of the device control instruction. For example, it may be a service execution instruction or a service information configuration instruction.
[0096] In the embodiment of the present application, the first instruction set may be actively sent by the main controller to the first controller, that is, after the first controller generates multiple device control instructions in real time based on the service to be processed, the generated device control instructions may be sent to the first controller. Among them, the main controller may send each generated device control instruction separately, or may merge and send the multiple currently generated device control instructions. The present application does not limit this.
[0097] In an embodiment of the present application, the first instruction set may also be actively obtained by the first controller from the master controller. The first controller may send a second instruction acquisition request to the master controller, where the second instruction acquisition request includes a second identifier for characterizing the device control instruction that the first controller has obtained. And receive the first instruction set sent by the master controller based on the second identifier. The first instruction set includes the device control instructions generated by the master controller that have not been obtained by the first controller. Optionally, since the master controller generates device control instructions in real time based on the received service to be processed, the first controller may send the second instruction acquisition request to the master controller periodically according to a first preset duration to obtain the latest device control instructions.
[0098] S120: Receive a first instruction acquisition request sent by the first execution device.
[0099] The first execution device is any service execution device, and the first instruction acquisition request includes a first identifier for characterizing the device control instruction that the first execution device has obtained.
[0100] Optionally, the service processing system further includes a load balancing server, and the first controller receives the first instruction acquisition request sent by the first execution device through the load balancing server. The first controller is the target slave controller determined by the load balancing server in the following manner:
[0101] Obtain a candidate controller set. The candidate controller set includes at least one slave controller determined from each slave controller based on the status of each slave controller, and the status of a slave controller characterizes whether the controller is abnormal.
[0102] Determine the target slave controller according to the load information of each slave controller in the candidate controller set. The load information of the slave controller characterizes the amount of service processing borne by the slave controller. The greater the load of the slave controller, the more service processing it bears. As an optional method, the slave controller with the smallest load may be selected as the target slave controller based on the load information of each slave controller in the candidate controller set.
[0103] Optionally, the candidate controller set may be received from the master controller. The candidate controller set is determined by the master controller in the following manner: Determine the status of each slave controller according to the device control instructions that each slave controller has obtained from the master controller, and determine the slave controllers with normal status as the candidate controller set.
[0104] Among them, the state of the slave controller characterizes whether the instruction synchronization progress between the slave controller and the master controller is within a controllable range. If the state of the slave controller is normal, the instruction synchronization progress between the slave controller and the master controller is within the controllable range, and the service execution device can obtain the latest device control instructions from the slave controller. If the state of the slave controller is abnormal, the instruction synchronization progress between the slave controller and the master controller exceeds the controllable range, and the service execution device cannot obtain the latest device control instructions from the slave controller.
[0105] Optionally, since each slave controller periodically sends a second instruction acquisition request to the master controller to obtain the latest device control instructions generated in real time, the second instruction acquisition request carries a second identifier characterizing the device control instructions already obtained by the slave controller. The master controller can determine the state of each slave controller according to the second identifier in the second instruction acquisition request received from each slave controller most recently. As an optional method, the instruction identifier of each device control instruction can be related to the generation time of the device control instruction, and the second identifier corresponding to the slave controller can be the instruction identifier of the latest generated device control instruction already obtained in the slave controller. The master controller sorts based on the generation time order of the second identifiers corresponding to each slave controller, and determines a preset number of slave controllers with the latest generation time corresponding to the second identifier as the candidate controller set.
[0106] Optionally, the first instruction set sent by the master controller includes at least one device control instruction and the instruction identifiers of each instruction in the at least one device control instruction. The instruction identifier of a device control instruction is related to the generation time of the device control instruction. For each slave controller, the master controller can determine the difference between the second identifier corresponding to the slave controller and the instruction identifiers of the device control instructions already generated in the master controller. Among them, this difference characterizes the number of device control instructions in the device control instructions already generated in the master controller that have not been obtained by the slave controller, that is, the instruction synchronization progress index. The second identifier corresponding to a slave controller is the instruction identifier of the latest generated device control instruction already obtained in the slave controller. For each slave controller, if the difference corresponding to the slave controller is greater than or equal to the first threshold, it is determined that the state of the slave controller is abnormal. If the difference corresponding to the slave controller is less than the first threshold, it is determined that the state of the slave controller is normal.
[0107] S130: Determine a third instruction set from the second instruction set according to the first identifier, and send the third instruction set to the first execution device for execution.
[0108] Among them, the second instruction set includes the device control instructions corresponding to the first execution device stored in the first controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been obtained by the first execution device.
[0109] Optionally, the first instruction acquisition request also carries the device identifier of the first execution device. Based on the device identifier of the first execution device, the first controller determines a second instruction set corresponding to the first execution device from multiple device control instructions stored in itself. Each device control instruction corresponds to the device identifier of the service execution device that executes the device control instruction.
[0110] Optionally, each device control instruction stored in the first controller corresponds to an instruction identifier. The instruction identifier of a device control instruction is related to the generation time of the device control instruction. The first identifier may be the instruction identifier of the latest device control instruction obtained by the first execution device.
[0111] The first controller can determine a third instruction set based on the first identifier and the instruction identifiers of the device control instructions in the second instruction set. The generation time of each device control instruction in the third instruction set is later than the generation time corresponding to the first identifier.
[0112] Based on Figure 1 In the shown service processing method, in this solution, the main controller generates corresponding device control instructions based on the received service to be processed and synchronizes the device control instructions to multiple slave controllers. The service execution device can obtain and execute instructions from any slave controller. Adopting this solution can avoid single-point failures, and by using the method that each service execution device actively obtains instructions from the service controller, the service controller does not need to actively manage the status of each service execution device, which can reduce the pressure on the service controller and reduce the resource overhead of the service controller, thereby effectively improving the service processing efficiency and better meeting the actual application requirements.
[0113] Optionally, when the main controller fails as the original main controller, a new main controller can be re-determined from multiple slave controllers. Moreover, since the device configurations of each slave controller are different and the progress of instruction synchronization from the original main controller by each slave controller is different, the newly determined new main controller also needs to select the slave controller with the fastest instruction synchronization progress from multiple new slave controllers and synchronize the latest device control instructions from it to ensure that the device control instructions stored in the new main controller are the latest among all slave controllers.
[0114] When the first controller is determined as the new main controller, the first controller can obtain a first instruction to be synchronized from other slave controllers based on the device control instructions already stored in itself. Other slave controllers are the slave controllers except the first controller among the multiple slave controllers. The first instruction to be synchronized refers to the device control instruction that other slave controllers have obtained from the original main controller and the first controller has not obtained.
[0115] Optionally, the first instruction to be synchronized can be obtained by the first controller in the following manner:
[0116] The first controller sends a synchronization pre-query request to each of the other slave controllers respectively, and receives the respective corresponding third identifiers sent by each of the other slave controllers in response to the synchronization pre-query request. Among them, the third identifier corresponding to each other slave controller is used to characterize the device control instructions that the other slave controller has obtained. Then, according to the third identifiers corresponding to each other slave controller, a synchronization controller is determined from each of the other slave controllers. Then, a synchronization instruction acquisition request is sent to the determined synchronization controller, where the synchronization instruction acquisition request carries the third identifier corresponding to the first controller, and the set of instructions to be synchronized sent by the synchronization controller in response to the synchronization instruction acquisition request is received. The set of instructions to be synchronized includes at least one device control instruction, which is the device control instruction that the synchronization controller has obtained from the original master controller and the first controller has not obtained.
[0117] Optionally, the third identifier is the instruction identifier of the latest generated device control instruction that the other slave controller has obtained, and the instruction identifier of the device control instruction is related to the generation time of the device control instruction. When determining the synchronization controller from each of the other slave controllers, based on the third identifiers corresponding to each of the other slave controllers, the third identifier with the latest generation time can be determined therefrom, and the other slave controller corresponding to the third identifier with the latest generation time is used as the synchronization controller.
[0118] Optionally, since each slave controller obtains device control instructions from the master controller for instruction synchronization, there is a certain delay in the device control instructions obtained by each slave controller. When the original master controller fails, there may be some device control instructions that have been generated in the original master controller but have not been obtained by any slave controller. To avoid instruction loss, when the original master controller resumes normal operation, the first controller, as the new master controller, can receive and store the second set of instructions to be synchronized sent by the original master controller, realizing automatic instruction synchronization after the original master controller is freed from the fault. Among them, the second set of instructions to be synchronized is the device control instruction that the original master controller has generated but has not been obtained by any slave controller. The first controller can send the obtained second set of instructions to be synchronized to each of the other slave controllers.
[0119] Optionally, before the first controller sends a synchronization instruction acquisition request to the synchronization controller, it can also determine whether the generation time corresponding to the third identifier of the first controller is later than the generation time corresponding to the third identifier of the synchronization controller based on the third identifier corresponding to itself and the third identifier corresponding to the synchronization controller. If so, it indicates that the device control instructions stored in the first controller are the latest among all slave controllers, and there is no need to synchronize instructions from other slave controllers.
[0120] The embodiment of the present application provides a service processing system, such as Figure 2As shown in the figure, the service processing system includes multiple service controllers 10 to 1n and multiple service execution devices 20 to 2m. Among them, the multiple service controllers include a main controller 10 and multiple slave controllers 11 to 1n. Communication connections can be established between the main controller 10 and each of the slave controllers 11 to 1n, and between the slave controllers 11 to 1n and the service execution devices 20 to 2m.
[0121] The main controller 10 in this system can obtain the service to be processed, generate device control instructions corresponding to the service to be processed, and send a first instruction set to each of the slave controllers 11 to 1n. Among them, the first instruction set includes at least one device control instruction. The present application embodiment does not limit the election mechanism for selecting the main controller 10 from the multiple service controllers 10 to 1n. For example, zookeeper (a distributed coordination service), paxos protocol (a decentralized distributed protocol), etc. can be adopted.
[0122] Optionally, the service processing system further includes a control terminal 30. The service object can set the service information of the service to be processed through the control terminal 30. In response to the service setting operation of the service object, the control terminal 30 sends a service processing request to the main controller 10, and the service processing request carries the service information of the service to be processed. Among them, the service object is the user who sets the service to be processed, and the service type of the service to be processed can be the cloud service corresponding to the cloud product. For example, cloud dedicated line service (virtual dedicated line service), and the service to be processed can be to open a virtual dedicated line from Shanghai to Beijing.
[0123] Any slave controller in this system can receive and store the first instruction set sent by the main controller 10, and can also receive a first instruction acquisition request sent by any service execution device. Among them, the first instruction acquisition request includes a first identifier, which is used to represent the device control instructions that have been acquired by any service execution device. The slave controller can also determine a third instruction set from the second instruction set according to the first identifier, and send the third instruction set to the service execution device. Among them, the second instruction set includes the device control instructions corresponding to any service execution device stored in any slave controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by the service execution device.
[0124] Optionally, for any slave controller, the slave controller may periodically send a second instruction acquisition request to the master controller 10 according to a preset duration. The second instruction acquisition request includes a second identifier, which is used to represent the device control instructions that have been acquired by the slave controller. Based on the second instruction acquisition requests sent by each slave controller, the master controller 10 respectively sends corresponding first instruction sets to each slave controller. Each first instruction set corresponding to each slave controller includes the device control instructions generated by the master controller 10 that have not been acquired by the slave controller. The first instruction sets received by different slave controllers are not completely the same. Optionally, since the master controller 10 generates device control instructions in real time based on the received service to be processed, each of the slave controllers 11 to 1n may periodically send a second instruction acquisition request to the master controller 10 to obtain the latest device control instructions.
[0125] Exemplarily, as Figure 3 shown, the master controller 10 generates corresponding device control instructions 1 to 5 based on the service to be processed and stores them in the database. The instruction identifier of the device control instruction represents the instruction generation time sequence. For each slave controller, the slave controller may send a first instruction acquisition request to the master controller 10 to obtain the corresponding first instruction set. The second identifier in the second instruction acquisition request may be the latest generated device control instruction stored in the corresponding slave controllers 11 to 1n. The latest generated device control instruction stored in the database of the slave controller 11 is the device control instruction 3, the latest generated device control instruction stored in the database of the slave controller 12 is the device control instruction 4, and the latest generated device control instruction stored in the database of the slave controller 1n is the device control instruction 2.
[0126] For each slave controller, the master controller 10 may determine the first instruction set corresponding to the slave controller based on the second identifier carried in the second instruction acquisition request sent by the slave controller and send it to the slave controller 10. Based on the instruction identifier 3 carried in the first instruction acquisition request sent by the slave controller 11, the master controller 10 determines that the first instruction set corresponding to the slave controller 11 is the device control instructions 4 to 5, that is, the device control instructions generated by the master controller that have not been acquired by the slave controller 11. Similarly, the first instruction set corresponding to the slave controller 12 is the device control instruction 5, and the first instruction set corresponding to the slave controller 1n is the device control instructions 3 to 5.
[0127] The service execution devices 20 to 2m in the system may send a first instruction acquisition request to any slave controller, and receive and execute the device control instructions in the third instruction set sent by the slave controller.
[0128] Since the service execution device actively sends a first instruction acquisition request to the slave controller to obtain the device control instruction, the slave controller does not need to manage the running states of the service execution devices and the connection states between the service execution devices and the slave controller, reducing the pressure on the service controller and making more reasonable use of computing resources.
[0129] Optionally, the service processing system further includes a load balancing server 40. Each service execution device 20-2m in the system can send the first instruction acquisition request to the load balancing server 40. The load balancing server 40 determines a target slave controller from the slave controllers 11-1n and forwards the first instruction acquisition request to the target slave controller.
[0130] Optionally, since each of the slave controllers 11-1n obtains the device control instruction from the master controller 10 for instruction synchronization, due to device configuration and other reasons, the number of device control instructions received by different slave controllers 11-1n is different. For example, the slave controller runs abnormally and the instruction synchronization lags behind significantly after restart; the network connection between the slave controller and the master controller is abnormal and the instruction synchronization efficiency is low; the slave controller has a low CPU configuration and processes many requests, resulting in a decline in processing performance, etc. For the slave controller with a significant lag in instruction synchronization, it cannot provide the latest device control instruction for the service execution device.
[0131] Then the load balancing server 40 can obtain a candidate controller set. The candidate controller set includes at least one slave controller determined from the slave controllers 11-1n based on the states of the slave controllers 11-1n. The state of a slave controller indicates whether the controller is abnormal. According to the load information of the slave controllers 11-1n in the candidate controller set, the target slave controller is determined according to the load information of the slave controllers 11-1n.
[0132] Optionally, the candidate controller set can be determined by the master controller 10 and sent to the load balancing server 40. The master controller 10 determines the states of the slave controllers 11-1n according to the device control instructions that the slave controllers 11-1n have obtained from the master controller 10, and determines the slave controllers with normal states as the candidate controller set.
[0133] Optionally, the master controller 10 determines the status of each slave controller 11 to 1n according to the second identifier in the second instruction acquisition request received from each slave controller 11 to 1n most recently. Specifically, for each slave controller, the master controller 10 can determine the difference between the second identifier corresponding to the slave controller and the instruction identifier of the device control instruction already generated in the master controller 10. Among them, the instruction identifier of the device control instruction is related to the generation time of the device control instruction. The second identifier corresponding to a slave controller is: the instruction identifier of the device control instruction that was most recently generated among the device control instructions already acquired by the slave controller. This difference represents the number of device control instructions that have been generated in the master controller but not acquired by the slave controller. For each slave controller, if the difference corresponding to the slave controller is greater than or equal to the first threshold, it is determined that the status of the slave controller is abnormal. If the difference corresponding to the slave controller is less than the first threshold, it is determined that the status of the slave controller is normal.
[0134] Assume that the service processing system includes a master controller A and slave controllers B1 to B5. The master controller A has currently generated device control instructions 1 to 50, and the instruction identifier of the device control instruction represents the order of instruction generation time. The second identifier in the second instruction acquisition request sent by each slave controller most recently is the instruction identifier of the latest device control instruction already acquired by each slave controller. Among them, the second identifier corresponding to the slave controller B1 is the instruction identifier 45, the second identifier corresponding to the slave controller B2 is the instruction identifier 44, the second identifier corresponding to the slave controller B3 is the instruction identifier 36, the second identifier corresponding to the slave controller B4 is the instruction identifier 46, and the second identifier corresponding to the slave controller B5 is the instruction identifier 39.
[0135] Based on the instruction identifier 50 of the latest device control instruction currently generated by the master controller A and the second identifiers corresponding to each slave controller received most recently, the instruction synchronization difference corresponding to each slave controller can be determined. As shown in Table 1, the instruction synchronization difference corresponding to the slave controller B1 is 5, that is, the instruction difference between the device control instructions already synchronized in the slave controller B1 and the latest device control instruction generated in the master controller A. The instruction synchronization difference corresponding to the slave controller B2 is 6, the instruction synchronization difference corresponding to the slave controller B3 is 14, the instruction synchronization difference corresponding to the slave controller B4 is 4, and the instruction synchronization difference corresponding to the second identifier of the slave controller B5 is 11.
[0136]
[0137]
[0138] Table 1
[0139] If the first threshold is 10, it can be determined that the slave controllers B3 and B5 with instruction synchronization differences greater than or equal to the first threshold are in an abnormal state, with a relatively large instruction synchronization difference, and the slave controllers B1, B2, and B4 with instruction synchronization differences less than the first threshold are in a normal state, with a relatively small instruction synchronization difference.
[0140] Figure 4 FIG. 4 is a schematic structural diagram of a service processing system provided by an embodiment of the present application. The service processing system includes a control terminal 30, a master controller 10, a plurality of slave controllers 11 to 1n, a load balancing server 40, and a plurality of service execution devices 20 to 2m. The control terminal 30 responds to a service setting operation of a service object and sends a service processing request to the master controller 10. The service processing request carries service information of the service to be processed. The master controller 10 can generate corresponding device control instructions based on the service to be processed. When receiving a second instruction acquisition request sent by any slave controller, the master controller sends a corresponding first instruction set to the slave controller. Any service execution device can send a first instruction acquisition request to the load balancing server 40, and the load balancing server 40 forwards the first instruction acquisition request to a target slave controller among the slave controllers 11 to 1n. The target slave controller can send a third instruction set to the service execution device based on the first instruction acquisition request, and the service execution device can execute the device control instructions in the third instruction set. Among them, the master controller 10 can send a candidate controller set to the load balancing server 40, so that the load balancing server 40 determines a target slave controller from the candidate controller set.
[0141] Optionally, the master controller 10 can periodically determine the states of the slave controllers 11 to 1n at a preset time interval and determine a candidate controller set for the corresponding period. Among them, if a slave controller is in an abnormal state for a long time, the master controller can send an alarm prompt to an operation and maintenance terminal to prompt the operation and maintenance personnel to perform equipment detection. When the slave controllers in the candidate controller set change, the updated candidate controller set is sent to the load balancing server 40.
[0142] Among them, the states of the slave controllers 11 to 1n change continuously due to factors such as the network and configuration. For example, if the instruction synchronization of a slave controller lags behind significantly after restarting due to abnormal operation, when the instruction synchronization difference of the slave controller is less than the first threshold, it can be re-determined to be in a normal state. If the processing performance of a slave controller decreases due to excessive processing requests, after removing the slave controller from the candidate controller set for a period of time, it can return to a normal state.
[0143] Optionally, each service controller 10 to 1n in the service processing system also corresponds to its own database for storing the device control instructions obtained by each service controller 10 to 1n.
[0144] When the main controller 10 fails as the original main controller, a new main controller can be re-determined from multiple slave controllers 11 to 1n. Since the instruction synchronization progress of each slave controller 11 to 1n is different from that of the main controller 10, in order to avoid instruction loss, the new main controller can query the instruction synchronization progress in each other slave controller to synchronize the latest device control instructions from the slave controller with the fastest instruction synchronization progress, and then send them to each new slave controller.
[0145] Optionally, the new main controller can send a synchronization pre-query request to other slave controllers and receive the respective third identifiers sent by each other slave controller in response to the synchronization pre-query request. Among them, the third identifier corresponding to each other slave controller is used to represent the device control instructions that the other slave controller has obtained. Then, according to the third identifiers corresponding to each other slave controller, a synchronization controller is determined from each other slave controller, and a synchronization instruction acquisition request is sent to the determined synchronization controller. The synchronization instruction acquisition request carries the third identifier corresponding to the new main controller, and the set of instructions to be synchronized sent by the synchronization controller in response to the synchronization instruction acquisition request is received. The set of instructions to be synchronized includes at least one device control instruction, which is the device control instruction that the synchronization controller has obtained from the original main controller and the new main controller has not obtained.
[0146] When the original main controller fails, there may be some device control instructions that have been generated in the original main controller but have not been obtained by any slave controller. In order to avoid instruction loss, when the original main controller resumes normal operation, the original main controller can send a second set of instructions to be synchronized to the new main controller. Among them, the second set of instructions to be synchronized is the device control instruction that the original main controller has generated but has not been obtained by any slave controller.
[0147] Optionally, the main controller can record the fourth identifier of the synchronized instructions among the generated device control instructions. The fourth identifier represents the instructions among the device control instructions generated by the main controller that have been obtained by any slave controller. For example, the main controller generates device control instructions 1 to 5, the slave controller 1 obtains device control instructions 1 to 3, and the slave controller 2 obtains device control instructions 1 to 4. Then, the fourth identifier of the synchronized instructions of the main controller is the instruction identifier 4 of the latest device control instruction that has been synchronized.
[0148] The main controller can update the fourth identifier based on the device control instructions pulled by any slave controller. When the main controller resumes normal operation from an abnormal state, the second set of instructions to be synchronized can be determined based on the fourth identifier of the synchronized instructions and the instruction identifier of the latest device control instruction generated by itself.
[0149] Exemplarily, Figure 5a is a schematic diagram of instruction synchronization when the original main controller is normal. Figure 5bIt is a schematic diagram of instruction synchronization after the failure of the original master controller. Assume that the service processing system includes a master controller and two slave controllers: Slave Controller 1 and Slave Controller 2. The master controller can generate corresponding device control instructions according to the service to be processed received from the control terminal. Slave Controller 1 and Slave Controller 2 can periodically obtain device control instructions from the master controller. Due to device differences such as device configurations of Slave Controller 1 and Slave Controller 2, the instruction synchronization progress of Slave Controller 1 and Slave Controller 2 is different. The master controller has generated device control instructions 1 to 5. Slave Controller 1 has synchronized device control instructions 1 to 3. Slave Controller 2 has synchronized device control instructions 1 to 4.
[0150] If the master controller fails at this time and Slave Controller 1 is re-elected as the new master controller, the new master controller can query the instruction synchronization progress of Slave Controller 2. Since the third identifier corresponding to Slave Controller 2 is greater than the third identifier corresponding to the new master controller, that is, the instruction synchronization progress of Slave Controller 2 is greater than that of the new master controller. Therefore, the new master controller can obtain device control instruction 4 from Slave Controller 2. Moreover, the new master controller can receive the service to be processed from the control terminal and continue to generate device control instruction 6.
[0151] Since there is still device control instruction 5 in the original master controller that has not been synchronized by any slave controller, to avoid instruction loss, when the original master controller resumes normal operation, the original master controller can send device control instruction 5 to the new master controller. The new master controller can store device control instruction 5 in the database and send it to each slave controller.
[0152] Based on Figure 2 the service processing system shown, the service processing system includes multiple service controllers including a master controller and multiple slave controllers, realizing the clustered deployment of service controllers. In this solution, the master controller generates corresponding device control instructions based on the received service to be processed and synchronizes the device control instructions to multiple slave controllers. The service execution device can obtain instructions from any slave controller and execute them. Adopting this solution can avoid single-point failures. Moreover, by adopting the method that each service execution device actively obtains instructions from the service controller, the service controller does not need to actively manage whether the status of each service execution device is abnormal, which can reduce the pressure on the service controller, reduce the resource overhead of the service controller, and thus can effectively improve the service processing efficiency and better meet the actual application requirements.
[0153] To facilitate better understanding and explanation of the method provided by the embodiments of the present application, the following introduces the optional implementation manners of the method provided by the present application in combination with a specific scenario example. In this scenario example, the cloud dedicated line service scenario is used as an example for illustration. Then the corresponding service processing system is a cloud dedicated line service system (virtual dedicated line service system). The service execution devices in the cloud dedicated line service scenario include network devices such as gateways, base stations, and routers.
[0154] Users can configure the virtual private line service to be processed through the cloud dedicated line management platform of the control terminal. For example, create a virtual private line between the headquarters of a Beijing enterprise and a branch of a Shanghai enterprise. In response to the user's configuration operation, the control terminal sends the service information of the virtual private line service to the main controller. Based on the service information of the virtual private line service, the main controller generates corresponding multiple device control instructions. Among them, the device control instructions generated by the main controller are the device control instructions for the network devices corresponding to the virtual private line between the headquarters of the Beijing enterprise and the branch of the Shanghai enterprise. Different virtual private lines correspond to different network devices. For example, the network devices used to create the Beijing-Shanghai virtual private line are different from those used to create the Beijing-Guangdong virtual private line. Different types of network devices correspond to different device control instructions. The device control instructions for the gateway include creating an encrypted tunnel, configuring a tunnel secret key, creating a virtual forwarding table, etc.; the device control instructions for the router include creating a route, configuring the Border Gateway Protocol (BGP); the device control instructions for the switch include Virtual Local Area Network (VLAN) configuration and Media Access Control (MAC) configuration.
[0155] Each slave controller can periodically send a second instruction acquisition request to the main controller according to a preset duration to obtain the latest device control instructions for instruction synchronization.
[0156] For any network device corresponding to the virtual private line service, the network device can periodically send a first instruction acquisition request to the load balancing server according to a preset duration. The load balancing server determines the target slave controller from the candidate control set and forwards the first instruction acquisition request to the target slave controller to obtain the latest device control instructions and execute them. For example, the router can configure the BGP protocol according to the received BGP protocol configuration instruction to exchange routing information between multiple autonomous systems.
[0157] The embodiment of the present application also provides a service processing method, as Figure 6 shown. This method is applied to a service processing system and is executed by the main controller in the service processing system. The system includes multiple service controllers and multiple service execution devices. The multiple service controllers include a main controller and multiple slave controllers. The service processing method may include the following S210 to S220.
[0158] S210: Obtain the service to be processed and generate device control instructions corresponding to the service to be processed.
[0159] S220: Send a first instruction set to each slave controller, so that any slave controller sends a corresponding third instruction set to each service execution device based on the first instruction set, and each service execution device executes the device control instructions in the third instruction set.
[0160] Optionally, for each slave controller, when the master controller receives a second instruction acquisition request sent by the slave controller, the master controller may send the first instruction set to the slave controller. Each slave controller may receive and store the first instruction set. The first instruction set includes at least one device control instruction, and the first instruction set corresponding to each slave controller includes the device control instructions generated by the master controller that have not been acquired by the slave controller.
[0161] For each slave controller, the slave controller may receive a first instruction acquisition request sent by a first execution device. The first execution device is any service execution device, and the first instruction acquisition request includes a first identifier, and the first identifier is used to represent the device control instructions acquired by the first execution device.
[0162] Determine a third instruction set from the second instruction set according to the first identifier, and send the third instruction set to the first execution device for execution; the second instruction set includes the device control instructions corresponding to the first execution device stored in any slave controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by the first execution device.
[0163] It should be noted that the above S110 - S130 have elaborated in detail the detailed processing flow with any slave controller as the execution entity, and the above service processing system has also elaborated the detailed content of each end of the master controller, slave controller, and service execution device. For the specific implementation of each end in the service processing flow, reference can be made to the above content, and the present application will not elaborate herein.
[0164] Based on the same principle as the service processing method provided in the embodiments of the present application, an embodiment of the present application provides a service processing device, which is deployed in the first controller of the service processing system. The service processing system includes multiple service controllers and multiple service execution devices. The multiple service controllers include a master controller and multiple slave controllers, and the first controller is any slave controller. The service processing device 300 may include an instruction acquisition module 310, a request reception module 320, and an instruction distribution module 330, as Figure 7 shown.
[0165] The instruction acquisition module 310 is configured to acquire and store a first instruction set from the master controller; the first instruction set includes at least one device control instruction, and the device control instruction is generated by the master controller based on the received service to be processed;
[0166] A request receiving module 320, configured to receive a first instruction acquisition request sent by a first execution device; wherein, the first execution device is any service execution device, and the first instruction acquisition request includes a first identifier, and the first identifier is used to represent a device control instruction acquired by the first execution device.
[0167] An instruction sending module 330, configured to determine a third instruction set from a second instruction set according to the first identifier, and send the third instruction set to the first execution device for execution; wherein, the second instruction set includes device control instructions corresponding to the first execution device stored in the first controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by the first execution device.
[0168] Optionally, the instruction acquisition module 310 may be configured to:
[0169] Send a second instruction acquisition request to the main controller, where the second instruction acquisition request includes a second identifier, and the second identifier is used to represent a device control instruction acquired by the first controller.
[0170] Receive a first instruction set sent by the main controller based on the second identifier; wherein, the first instruction set includes device control instructions generated by the main controller that have not been acquired by the first controller.
[0171] Optionally, the system further includes a load balancing server.
[0172] The request receiving module 320 may be configured to:
[0173] Receive a first instruction acquisition request sent by the first execution device through the load balancing server.
[0174] Wherein, the first controller is a target slave controller determined by the load balancing server in the following manner:
[0175] Obtain a candidate controller set; the candidate controller set includes at least one slave controller determined from each slave controller based on the status of each slave controller, and the status of a slave controller indicates whether the controller is abnormal.
[0176] Determine a target slave controller according to the load information of each slave controller in the candidate controller set.
[0177] Optionally, the candidate controller set is received from the main controller.
[0178] Wherein, the candidate controller set is determined by the main controller in the following manner:
[0179] Determine the status of each of the slave controllers according to the device control instructions that each of the slave controllers has obtained from the master controller.
[0180] Determine the slave controllers with normal status as the candidate controller set.
[0181] Optionally, the status of each of the slave controllers is determined by the master controller in the following manner:
[0182] Determine the status of each slave controller according to the second identifier in the second instruction acquisition request received by each slave controller most recently.
[0183] Optionally, the first instruction set includes at least one device control instruction and the instruction identifiers of the instructions in the at least one device control instruction, wherein the instruction identifier of a device control instruction is related to the generation time of the device control instruction.
[0184] The status of each of the slave controllers is determined by the master controller in the following manner:
[0185] For each of the slave controllers, determine the difference between the second identifier corresponding to the slave controller and the instruction identifier of the device control instruction generated in the master controller; wherein, the second identifier corresponding to a slave controller is: the instruction identifier of the most recently generated device control instruction among the device control instructions obtained by the slave controller; the difference characterizes the number of device control instructions generated in the master controller that have not been obtained by the slave controller.
[0186] For each of the slave controllers, if the difference corresponding to the slave controller is greater than or equal to the first threshold, determine the status of the slave controller as abnormal, and if the difference corresponding to the slave controller is less than the first threshold, determine the status of the slave controller as normal.
[0187] Optionally, the service processing device 300 further includes a controller update module.
[0188] When the master controller fails as the original master controller and the first controller is determined as the new master controller, the controller update module can be used for:
[0189] Based on the device control instructions stored in the first controller, obtain first synchronization instructions from other slave controllers; the other slave controllers are the slave controllers other than the first controller among the multiple slave controllers, wherein the first synchronization instructions refer to the device control instructions that the other slave controllers have obtained from the original master controller and the first controller has not obtained.
[0190] Optionally, the controller update module may be configured to:
[0191] Send synchronization pre-query requests to each of the other slave controllers respectively;
[0192] Receive the respective third identifiers sent by each of the other slave controllers in response to the synchronization pre-query request; the third identifier corresponding to each other slave controller is used to characterize the device control instructions that the other slave controller has obtained;
[0193] Determine a synchronization controller from each of the other slave controllers according to the third identifiers corresponding to each of the other slave controllers;
[0194] Send a synchronization instruction acquisition request to the synchronization controller, where the synchronization instruction acquisition request carries the third identifier corresponding to the first controller;
[0195] Receive the set of instructions to be synchronized sent by the synchronization controller in response to the synchronization instruction acquisition request, and the set of instructions to be synchronized includes at least one device control instruction.
[0196] Optionally, when the original master controller resumes normal operation, the controller update module is further configured to:
[0197] Receive and store the second set of instructions to be synchronized sent by the original master controller, where the second set of instructions to be synchronized is the device control instructions that the original master controller has generated but not obtained by any slave controller;
[0198] Send the second set of instructions to be synchronized to each of the other slave controllers.
[0199] An embodiment of the present application further provides a service processing device, which is deployed in the master controller of a service processing system. The service processing system includes a plurality of service controllers and a plurality of service execution devices. The plurality of service controllers include one master controller and a plurality of slave controllers. The service processing device 400 may include an instruction generation module 410 and an instruction distribution module 420, as Figure 8 shown.
[0200] The instruction generation module 410 is configured to obtain a service to be processed and generate a device control instruction corresponding to the service to be processed;
[0201] The instruction distribution module 420 is configured to send a first set of instructions to each of the slave controllers, where the first set of instructions includes at least one device control instruction; so that any slave controller performs the following operations:
[0202] Receive a first instruction acquisition request sent by a first execution device; wherein, the first execution device is any service execution device, and the first instruction acquisition request includes a first identifier, and the first identifier is used to represent a device control instruction acquired by the first execution device.
[0203] Determine a third instruction set from a second instruction set according to the first identifier, and send the third instruction set to the first execution device for execution; wherein, the second instruction set includes device control instructions corresponding to the first execution device stored in any slave controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by the first execution device.
[0204] The device in the embodiment of the present application can execute the method provided in the embodiment of the present application, and its implementation principle is similar. The actions performed by each module in the device in each embodiment of the present application correspond to the steps in the method in each embodiment of the present application, and can achieve the same technical effects as the method. For the detailed function descriptions of the modules of the device, reference can specifically be made to the descriptions in the corresponding methods shown above, and will not be elaborated here.
[0205] In the embodiment of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, and works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.
[0206] In the embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory. When the processor executes the computer program stored in the memory, the method in any optional embodiment of the present application can be implemented.
[0207] Figure 9 The structural schematic diagram of an electronic device applicable to the embodiment of the present invention is shown, as Figure 9 shown, the electronic device can be a server or a user terminal, and the electronic device can be used to implement the method provided in any embodiment of the present invention.
[0208] As Figure 9 shown, the electronic device 2000 mainly includes at least one processor 2001 ( Figure 9 one is shown), a memory 2002, a communication module 2003, and an input / output interface 2004, etc. Optionally, the components can be connected and communicate through a bus 2005. It should be noted that,Figure 9 The structure of the electronic device 2000 shown is only schematic and does not constitute a limitation on the electronic device applicable to the method provided in the embodiments of the present application.
[0209] Among them, the memory 2002 can be used to store the operating system and application programs, etc. The application program can include a computer program that implements the method shown in the embodiments of the present invention when called by the processor 2001, and can also include a program for implementing other functions or services. The memory 2002 can be a ROM (Read Only Memory), or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory), or other types of dynamic storage devices that can store information and computer programs, or it can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0210] The processor 2001 is connected to the memory 2002 through the bus 2005 and realizes corresponding functions by calling the application programs stored in the memory 2002. Among them, the processor 2001 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof, which can implement or execute various exemplary logic blocks, modules, and circuits described in connection with the disclosure of the present invention. The processor 2001 can also be a combination that realizes computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0211] The electronic device 2000 can be connected to a network through a communication module 2003 (which can include but is not limited to components such as a network interface) to communicate with other devices (such as user terminals or servers, etc.) through the network, realizing data interaction, such as sending data to other devices or receiving data from other devices. Among them, the communication module 2003 can include a wired network interface and / or a wireless network interface, etc., that is, the communication module can include at least one of a wired communication module or a wireless communication module.
[0212] The electronic device 2000 can be connected to the required input / output devices through an input / output interface 2004, such as a keyboard, a display device, etc. The electronic device 2000 itself can have a display device and can also externally connect other display devices through the interface 2004. Optionally, a storage device, such as a hard disk, etc., can also be connected through the interface 2004 to store the data in the electronic device 2000 into the storage device, or read the data in the storage device, and the data in the storage device can also be stored in the memory 2002. It can be understood that the input / output interface 2004 can be a wired interface or a wireless interface. According to different actual application scenarios, the devices connected to the input / output interface 2004 can be components of the electronic device 2000 or external devices connected to the electronic device 2000 when needed.
[0213] The bus 2005 for connecting each component can include a path to transfer information between the above components. The bus 2005 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. According to different functions, the bus 2005 can be divided into an address bus, a data bus, a control bus, etc.
[0214] Optionally, for the solution provided by the embodiments of the present invention, the memory 2002 can be used to store a computer program for executing the solution of the present invention, and the processor 2001 runs the computer program to implement the actions of the method or device provided by the embodiments of the present invention.
[0215] Based on the same principle as the method provided by the embodiments of the present application, the embodiments of the present application provide a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the corresponding content of the foregoing method embodiments can be implemented.
[0216] The embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the corresponding content of the foregoing method embodiment can be implemented.
[0217] It should be noted that the terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the description, claims and the above drawings of the present application are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than the illustrated or textually described order.
[0218] It should be understood that although the flowchart of the embodiment of the present application indicates each operation step by an arrow, the execution order of these steps is not limited to the order indicated by the arrow. Unless there is a clear description in this article, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be executed in other orders according to requirements. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage among these sub-steps or stages can also be executed at different times respectively. In the scenario where the execution times are different, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and the embodiment of the present application does not limit this.
[0219] The above are only optional implementation manners of some implementation scenarios of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the technical concept of the solution of the present application, using other similar implementation means based on the technical idea of the present application also belongs to the protection scope of the embodiments of the present application.
Claims
1. A service processing method, characterized in that, The method is applied to a service processing system, which includes multiple service controllers and multiple service execution devices. The multiple service controllers include a main controller and multiple slave controllers; The method is executed by a first controller, which is any one of the slave controllers. The method includes: Obtaining and storing a first instruction set from the main controller. The first instruction set includes at least one device control instruction, and the device control instruction is generated by the main controller based on the received service to be processed; Receiving a first instruction acquisition request sent by a first execution device. Wherein, the first execution device is any one of the service execution devices, and the first instruction acquisition request includes a first identifier, which is used to represent the device control instruction that the first execution device has obtained; Determining a third instruction set from a second instruction set according to the first identifier, and sending the third instruction set to the first execution device for execution. Wherein, the second instruction set includes the device control instructions corresponding to the first execution device stored in the first controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been obtained by the first execution device; 2. The method according to claim 1, wherein The obtaining and storing the first instruction set from the main controller includes: Sending a second instruction acquisition request to the main controller. Wherein, the second instruction acquisition request includes a second identifier, which is used to represent the device control instruction that the first controller has obtained; Receiving the first instruction set sent by the main controller based on the second identifier. Wherein, the first instruction set includes the device control instructions generated by the main controller that have not been obtained by the first controller; 3. The method according to claim 1, wherein The system further includes a load balancing server; The receiving the first instruction acquisition request sent by the first execution device includes: Receiving the first instruction acquisition request sent by the first execution device through the load balancing server; Wherein, the first controller is the target slave controller determined by the load balancing server in the following manner: Obtaining a candidate controller set. The candidate controller set includes at least one slave controller determined from each slave controller based on the status of each slave controller, and the status of a slave controller represents whether the controller is abnormal; Determining the target slave controller according to the load information of each slave controller in the candidate controller set; 4. The method according to claim 3, wherein The obtaining the candidate controller set includes: Receiving the candidate controller set from the main controller; Wherein, the candidate controller set is determined by the main controller in the following manner: Determining the status of each slave controller according to the device control instructions that each slave controller has obtained from the main controller; Determining each slave controller with normal status as the candidate controller set; 5. The method according to claim 2 or 4, characterized in that The determining the status of each slave controller according to the device control instructions that each slave controller has obtained from the main controller includes: Determining the status of each slave controller according to the second identifier in the second instruction acquisition request received by each slave controller last time.
6. The method according to claim 5, characterized in that, The first instruction set includes at least one device control instruction and instruction identifiers of each instruction in the at least one device control instruction, wherein the instruction identifier of a device control instruction is related to the generation time of the device control instruction; Determining the status of each slave controller according to the second identifier in the second instruction acquisition request received from each slave controller most recently, includes: For each slave controller, determining the difference between the second identifier corresponding to the slave controller and the instruction identifier of the device control instruction generated in the master controller; wherein, the second identifier corresponding to a slave controller is: the instruction identifier of the most recently generated device control instruction among the device control instructions acquired by the slave controller; the difference characterizes the number of device control instructions generated in the master controller that have not been acquired by the slave controller; For each slave controller, if the difference corresponding to the slave controller is greater than or equal to a first threshold, determining the status of the slave controller as abnormal, if the difference corresponding to the slave controller is less than the first threshold, determining the status of the slave controller as normal.
7. The method according to claim 1, wherein When the master controller fails as the original master controller and the first controller is determined as the new master controller, the method further includes: Based on the device control instructions stored in the first controller, acquiring first instructions to be synchronized from other slave controllers; the other slave controllers are the slave controllers other than the first controller among the multiple slave controllers, wherein the first instructions to be synchronized refer to the device control instructions that the other slave controllers have acquired from the original master controller and the first controller has not acquired.
8. The method according to claim 7, wherein The acquiring first instructions to be synchronized from other slave controllers based on the device control instructions stored in the first controller, includes: Sending synchronization pre-query requests to each of the other slave controllers respectively; Receiving the respective third identifiers sent by each of the other slave controllers in response to the synchronization pre-query request; the third identifier corresponding to each other slave controller is used to characterize the device control instructions acquired by the other slave controller; Determining a synchronization controller from each of the other slave controllers according to the third identifiers corresponding to each of the other slave controllers; Sending a synchronization instruction acquisition request to the synchronization controller, wherein the synchronization instruction acquisition request carries the third identifier corresponding to the first controller; Receiving the instruction set to be synchronized sent by the synchronization controller in response to the synchronization instruction acquisition request, the instruction set to be synchronized includes at least one device control instruction.
9. The method according to claim 7, characterized in that, When the original master controller resumes normal operation, the method further includes: Receiving and storing the second instructions to be synchronized sent by the original master controller, wherein the second instructions to be synchronized are the device control instructions generated by the original master controller but not acquired by any slave controller; Sending the second instructions to be synchronized to each of the other slave controllers.
10. A service processing method, characterized in that, The method is applied to a service processing system, the system includes a plurality of service controllers and a plurality of service execution devices, the plurality of service controllers include a master controller and a plurality of slave controllers; The method is executed by the master controller, the method includes: Obtain the business to be processed and generate a device control instruction corresponding to the business to be processed; Send a first instruction set to each of the slave controllers, where the first instruction set includes at least one device control instruction; so that any slave controller performs the following operations: Receive a first instruction acquisition request sent by a first execution device; where the first execution device is any business execution device, and the first instruction acquisition request includes a first identifier, and the first identifier is used to represent the device control instruction that the first execution device has acquired; Determine a third instruction set from a second instruction set according to the first identifier, and send the third instruction set to the first execution device for execution; where the second instruction set includes device control instructions corresponding to the first execution device stored in any slave controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by the first execution device.
11. A service processing system, characterized in that, The system includes a plurality of business controllers and a plurality of business execution devices, and the plurality of business controllers include a master controller and a plurality of slave controllers; Wherein: The master controller is configured to obtain the business to be processed and generate a device control instruction corresponding to the business to be processed; send a first instruction set to each of the slave controllers, where the first instruction set includes at least one device control instruction; Any slave controller is configured to receive and store the first instruction set sent by the master controller; receive a first instruction acquisition request sent by any business execution device; where the first instruction acquisition request includes a first identifier, and the first identifier is used to represent the device control instruction that any business execution device has acquired; determine a third instruction set from a second instruction set according to the first identifier, and send the third instruction set to any business execution device; where the second instruction set includes device control instructions corresponding to any business execution device stored in any slave controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by any business execution device; Any business execution device is configured to send a first instruction acquisition request to any slave controller; receive and execute the device control instructions in the third instruction set sent by any slave controller.
12. A service processing device, characterized in that, The device is deployed in a first controller of a business processing system; the system includes a plurality of business controllers and a plurality of business execution devices, the plurality of business controllers include a master controller and a plurality of slave controllers, and the first controller is any slave controller; The device includes: An instruction acquisition module, configured to acquire and store a first instruction set from the master controller; the first instruction set includes at least one device control instruction, and the device control instruction is generated by the master controller based on the received business to be processed; A request receiving module, configured to receive a first instruction acquisition request sent by a first execution device; where the first execution device is any business execution device, and the first instruction acquisition request includes a first identifier, and the first identifier is used to represent the device control instruction that the first execution device has acquired; An instruction issuing module, configured to determine a third instruction set from a second instruction set according to the first identifier, and send the third instruction set to the first execution device for execution; wherein, the second instruction set includes device control instructions corresponding to the first execution device stored in the first controller, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by the first execution device.
13. A service processing device, characterized in that, The device is deployed in the main controller of the service processing system; the system includes a plurality of service controllers and a plurality of service execution devices, and the plurality of service controllers include a main controller and a plurality of slave controllers; The device includes: An instruction generation module, configured to obtain a service to be processed and generate a device control instruction corresponding to the service to be processed; An instruction issuing module, configured to send a first instruction set to each of the slave controllers, where the first instruction set includes at least one device control instruction; so that any slave controller performs the following operations: Receive a first instruction acquisition request sent by a first execution device; wherein, the first execution device is any service execution device, and the first instruction acquisition request includes a first identifier, and the first identifier is used to represent the device control instructions acquired by the first execution device; According to the first identifier, determine a third instruction set from the second instruction set, and send the third instruction set to the first execution device for execution; wherein, the second instruction set includes device control instructions corresponding to the first execution device stored in any of the slave controllers, and the third instruction set includes at least one device control instruction in the second instruction set that has not been acquired by the first execution device.
14. An electronic device, characterized in that, The electronic device includes a memory and a processor, and a computer program is stored in the memory, and the processor executes the computer program to implement the method according to claims 1 to 9 or claim 10.
15. A computer-readable storage medium, characterized in that, A computer program is stored in the storage medium, and when the computer program is executed by a processor, the method according to claims 1 to 9 or claim 10 is implemented.
16. A computer program product, characterized in that, The computer product includes a computer program, and when the computer program is executed by a processor, the method according to claims 1 to 9 or claim 10 is implemented.