Methods, apparatuses, systems, electronic devices, and storage media for waking up a controller

By waking up the target controller through the manager, and combining channels and inter-process communication, the problems of untimely task processing and resource waste in Kubernetes controllers are solved, and efficient data operation and resource optimization are achieved.

CN115640056BActive Publication Date: 2026-08-04BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING BAIDU NETCOM SCI & TECH CO LTD
Filing Date
2022-10-25
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

In existing technologies, the Kubernetes controller is limited by the backend storage solution in terms of task volume and data size, resulting in untimely task processing and high CPU resource consumption. Furthermore, its reliance on etcd or similar modules limits its application scenarios.

Method used

The manager wakes up the target controller, determines and wakes up the corresponding controller to perform data operations based on the event to be processed, and uses channel or inter-process communication to transmit events, reducing database involvement. Combined with rule matching and intelligent analysis, unnecessary wake-ups are avoided.

Benefits of technology

It improves the timeliness of data operations, reduces CPU usage and database pressure, avoids resource waste and system limitations, and implements a flexible controller wake-up mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115640056B_ABST
    Figure CN115640056B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, system, electronic device, and storage medium for waking up controllers, relating to the field of cloud computing technology, particularly microservices and container technology. The specific implementation involves: in response to receiving at least one pending event from a server, determining at least one target controller corresponding to each pending event; the target controller performing data operations corresponding to its respective pending event; waking up all target controllers corresponding to the at least one pending event, enabling each target controller to execute its corresponding data operations. This disclosure can reduce CPU usage and lower database pressure while ensuring the timeliness of data operation completion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of cloud computing technology, and in particular to the fields of microservice technology and container technology. Specifically, this disclosure relates to a method, apparatus, system, electronic device, and storage medium for waking up a controller. Background Technology

[0002] The declarative programming model, represented by Kubernetes, is becoming increasingly popular. The mainstream approach to declarative programming is to write controllers and operators based on the CRD (Custom Resource Definition) mechanism provided by Kubernetes, and then execute operations and run tasks through the controller. Summary of the Invention

[0003] This disclosure provides a method, apparatus, system, electronic device, and storage medium for waking up a controller.

[0004] According to a first aspect of this disclosure, a method for waking up a controller is provided, applied to a manager, the method comprising:

[0005] In response to receiving at least one pending event from the server, at least one target controller is determined for each pending event; the target controller is used to perform data operations corresponding to its corresponding pending event.

[0006] Wake up all target controllers corresponding to the at least one pending event, and enable each target controller to perform the data operation corresponding to its pending event.

[0007] According to a second aspect of this disclosure, a method for a wake-up controller for a server is provided, the method comprising:

[0008] Based on the data operations to be performed, generate events to be processed;

[0009] The pending event is sent to the manager, so that the manager determines at least one target controller corresponding to the pending event and wakes up all the target controllers to execute the pending data operation.

[0010] According to a third aspect of this disclosure, an apparatus for a wake-up controller is provided, applied to a manager, the apparatus comprising:

[0011] A controller determination module is configured to, in response to receiving at least one pending event sent by a server, determine at least one target controller corresponding to each pending event; the target controller is configured to perform data operations corresponding to its respective pending event.

[0012] The wake-up controller module is used to wake up all target controllers corresponding to the at least one pending event, so that each target controller can perform the data operation corresponding to its pending event.

[0013] According to a fourth aspect of this disclosure, an apparatus for a wake-up controller is provided, applied to a server, the apparatus comprising:

[0014] The generation module is used to generate events to be processed based on the data operations to be performed.

[0015] The sending module is used to send the event to be processed to the manager, so that the manager can determine at least one target controller corresponding to the event to be processed based on the event to be processed, and wake up all the target controllers so that the target controllers can execute the data operation to be executed.

[0016] According to a fifth aspect of this disclosure, a system for a wake-up controller is provided, the system comprising:

[0017] The manager is configured to perform the wake-up controller method provided in the first aspect above;

[0018] A server, which is used to perform the wake-up controller method provided in the second aspect above.

[0019] According to a sixth aspect of this disclosure, an electronic device is provided, the electronic device comprising:

[0020] At least one processor; and

[0021] A memory communicatively connected to at least one of the aforementioned processors; wherein,

[0022] The memory stores instructions that can be executed by at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the wake-up controller method provided in the first aspect, or to perform the wake-up controller method provided in the second aspect.

[0023] According to a seventh aspect of this disclosure, a non-transitory computer-readable storage medium is provided that stores computer instructions, wherein the computer instructions are configured to cause a computer to perform the wake-up controller method provided in the first aspect, or to perform the wake-up controller method provided in the second aspect.

[0024] According to a seventh aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the wake-up controller method provided in the first aspect, or implements the wake-up controller method provided in the second aspect.

[0025] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0026] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0027] Figure 1 This is a flowchart illustrating a method for waking up a controller according to an embodiment of this disclosure;

[0028] Figure 2 This is a flowchart illustrating another method for waking up a controller provided in an embodiment of this disclosure;

[0029] Figure 3 This is a flowchart illustrating a method for waking up a controller according to an embodiment of this disclosure;

[0030] Figure 4 This is a schematic diagram of a specific embodiment of a wake-up control method provided in this disclosure;

[0031] Figure 5 This is a schematic diagram of a specific embodiment of a method for waking up a controller provided in this disclosure;

[0032] Figure 6 This is a schematic diagram of the structure of a wake-up controller for a manager provided in an embodiment of this disclosure;

[0033] Figure 7 This is a schematic diagram of a device for a wake-up controller applied to a server, provided in an embodiment of this disclosure;

[0034] Figure 8 This is a schematic diagram of the structure of a wake-up controller system provided in an embodiment of the present disclosure;

[0035] Figure 9 This is a block diagram of an electronic device used to implement the wake-up controller method of the embodiments of this disclosure. Detailed Implementation

[0036] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0037] While executing operations and running tasks using a Kubernetes-based controller is convenient, certain characteristics of Kubernetes also limit its application scenarios. For example, the number of tasks the controller can run and the data size of each task are limited by the Kubernetes backend storage solution. Taking a typical storage solution like etcd (distributed registry service center) as an example, it can only support 100,000-level tasks, with a default data size limit of 1MB (megabytes).

[0038] In some related technologies, the controller periodically scans the database (DB) to check if there are any unfinished tasks corresponding to the controller. If so, the controller executes the task; otherwise, the controller goes into hibernation to reduce the amount of tasks running on the controller.

[0039] If you want tasks to be scanned as quickly as possible, you need to shorten the database scanning cycle. However, doing so will put pressure on the database and cause the controller to consume more CPU (Central Processing Unit) resources.

[0040] To reduce database pressure and CPU resource consumption, the database scanning cycle must be lengthened. However, a longer scanning cycle may result in tasks not being scanned in time and thus not being processed promptly.

[0041] In some related technologies, modules with list-watch functionality are used to monitor basic components such as etcd in real time. When an external module creates, updates, or deletes data in etcd, the corresponding controller is activated to perform the appropriate operation. However, this requires the system to have etcd or a module that supports similar list-watch functionality, which further limits the application scenarios.

[0042] To address at least one of the aforementioned deficiencies, this disclosure provides a method for waking up a controller for a controller manager, a method for waking up a controller for a server, a controller manager, and a server.

[0043] Figure 1 This is a flowchart illustrating a method for waking up a controller according to an embodiment of this disclosure. The method for waking up a controller according to this embodiment is applied to a manager. Figure 1 As shown, this method mainly includes:

[0044] S101. In response to receiving at least one pending event sent by the server, determine at least one target controller corresponding to each pending event.

[0045] The target controller is used to perform data operations corresponding to its respective pending events.

[0046] The server can be a user server, or any program or tool that can communicate with the manager. Multiple pending events received by the manager can come from different servers.

[0047] Pending events can be generated by the server based on data operations. For example, if a user sends a request through the server to perform a data operation on data in the database (including adding, deleting, modifying, or querying data), the server generates a pending event corresponding to that data operation and sends the pending event to the manager.

[0048] In some possible implementations, the manager can be a controller manager, which wakes up the controllers it manages and controls the controllers it manages to perform data operations.

[0049] For each pending event, after receiving the pending event, the manager determines the controller that will perform the data operation corresponding to the pending event as the target controller.

[0050] The target controller for a pending event can be any of the controllers that perform the data operation. Since a data operation may require the cooperation of multiple controllers, the number of target controllers for a pending event can be multiple.

[0051] S102: Wake up all target controllers corresponding to at least one pending event, and enable each target controller to perform the data operation corresponding to its pending event.

[0052] For each pending event, after determining the target controller, the manager can wake up all target controllers corresponding to that pending event. The woken target controllers will then perform the data operations corresponding to the pending event based on the content of that pending event.

[0053] In the method provided in this embodiment, the manager wakes up the controller based on the pending event. The manager wakes up the controller corresponding to the pending event after receiving the pending event, which can ensure the timeliness of data operation completion.

[0054] Meanwhile, the manager wakes up the controller corresponding to the event to be processed; controllers not involved in data operations are not woken up. This reduces CPU usage and lowers database pressure while ensuring the timeliness of data operations. Furthermore, each controller is only woken up when there is a data operation to be performed; it is no longer woken up at a fixed frequency but flexibly activated based on demand.

[0055] In one alternative embodiment of this disclosure, when the manager and the server are running the same process, or the same binary program, the manager obtains pending events sent by the server through a channel; that is, the server sends pending events to the controller manager through a channel.

[0056] In other words, before determining at least one target controller corresponding to each pending event in response to receiving at least one pending event sent by the server, the process may also include obtaining the pending events sent by the server via a channel.

[0057] A channel is a method of inter-process communication. It is essentially a memory buffer. Through a channel, the output of one module can be obtained by modules running in the same process.

[0058] When the manager and server are running in the same process, the server's output (such as pending events) can be accessed by the manager.

[0059] In one alternative embodiment of this disclosure, when the manager and the server are running different processes, or different binary programs, the manager obtains pending events sent by the server through inter-process communication, that is, the server sends pending events to the manager through inter-process communication.

[0060] In other words, before determining at least one target controller corresponding to each pending event in response to receiving at least one pending event sent by the server, the process may also include obtaining the pending events sent by the server through inter-process communication.

[0061] Inter-process communication includes, but is not limited to, MQ (Message Queue), TCP (Transmission Control Protocol) / UDP (User Datagram Protocol) communication protocols, MySQL (Relational Database Management System), and Redis (Remote Dictionary Server).

[0062] Sending pending events to the controller manager via a channel is faster than sending them via inter-process communication.

[0063] Events to be processed can be sent to the controller manager via a channel, with the timeliness of the events being in the nanosecond (ns) range; or via inter-process communication, with the timeliness of the events being in the second (s) range.

[0064] The timeliness of the pending event is the time interval between the server generating the event and the controller manager waking up the corresponding controller.

[0065] Whether the pending events are sent to the controller manager via channel or inter-process communication, the events are sent directly to the controller manager without the need for database involvement, making it more convenient.

[0066] In one alternative embodiment of this disclosure, regardless of whether the manager and the server are running different processes, the server can send pending events to the database. The event-sync controller in the controller manager will scan the database at predetermined intervals (such as every second or every minute) based on a timer and send the pending events in the database to the manager through a channel.

[0067] In other words, before determining at least one target controller corresponding to each pending event in response to receiving at least one pending event sent by the server, the system may also include scanning the database at predetermined intervals to obtain pending events sent by the server to the database.

[0068] Sending pending events to the database is equivalent to creating a queue of pending events in the database, which allows the controller manager to read multiple pending events at once and process them centrally.

[0069] In one alternative approach disclosed herein, if the number of pending events sent by the server is too frequent, the server can be intercepted, specifically including:

[0070] In response to receiving at least one pending event from the server, determine the number of pending events sent by the server within a preset time period;

[0071] If the number of events exceeds a preset threshold, the server will be blocked.

[0072] In other words, the manager determines the number of pending events generated by different servers within a preset time period based on the pending events received within that time period. Servers that generate too many events will have their traffic controlled and be blocked. The specific blocking strategy can be a token bucket mechanism. This disclosure does not restrict the specific blocking strategy.

[0073] By controlling the traffic of servers that generate events too frequently, we can ensure that pending events generated by other servers can be sent to the manager, and at the same time, we can prevent attacks on the manager by some malicious servers.

[0074] In one alternative embodiment of this disclosure, in response to receiving at least one pending event sent by the server, determining at least one target controller corresponding to each pending event may further include:

[0075] In response to receiving at least one pending event from the server, each pending event is matched with a preset rule set corresponding to multiple controllers to determine at least one target controller corresponding to each pending event.

[0076] In some implementations, each controller registers a set of rules it is interested in. These rule sets represent the matching relationships between controllers and events, and the matching relationships can be expressed using regular expressions. The matching function is `regexp.MatchString` in Go. The manager continues to match the Uniform Resource Locator (URL) of the pending events received from the server with each controller's rule set to determine which controller needs to be woken up.

[0077] For example, the rule set registered by controller 1 is "event+A", and the rule set registered by controller 2 is "event+B".

[0078] When the manager receives event A to be processed from the server, with the corresponding URL being "http: / / event.A.com", the manager uses the matching function, namely the regexp.MatchString function, to match "http: / / event.A.com" with the rule sets corresponding to controller 1 and controller 2, that is, with "event+A" and "event+B" respectively. The corresponding matching results are "True" and "False" respectively.

[0079] Based on the matching results, the manager determines that controller 1 is the target controller corresponding to the event A to be processed, while controller 2 is not the target controller corresponding to the event A to be processed.

[0080] Rule set matching allows for convenient and quick identification of the target controller corresponding to the event to be processed, and it is easy to implement.

[0081] In one alternative method disclosed herein, the Timer triggers the intelligent analysis module of the controller manager at certain intervals to analyze and confirm which controllers have reached the corresponding preset maximum non-running time. If the time has been reached, the corresponding controller is woken up.

[0082] In other words, the manager's intelligent analysis module obtains the inactivity duration of unwakeable controllers at preset intervals; if the inactivity duration of an unwakeable controller exceeds the preset maximum inactivity duration for that controller, the controller is woken up.

[0083] By monitoring the inactivity time of the controllers, the situation where some important controllers (such as those related to system operation) cannot be woken up after going into sleep mode is avoided, thus ensuring the normal operation of the system.

[0084] In one optional embodiment of this disclosure, the target controller is woken up by generating a wake-up command. Specifically, for each target controller, a wake-up command is generated and sent to the target controller to wake it up, causing the target controller to perform the data operation corresponding to its pending event.

[0085] In some specific implementations, waking up all target controllers corresponding to at least one pending event, and enabling each target controller to perform the data operation corresponding to its pending event, can be achieved by generating a wake-up command for each target controller and sending the wake-up command to the corresponding target controller to wake it up, so that the target controller can perform the data operation corresponding to its pending event.

[0086] Figure 2 This is a flowchart illustrating another method for waking up a controller provided in an embodiment of this disclosure. (Refer to...) Figure 2 After receiving pending events, the controller manager does not immediately process them. Instead, it groups all pending events received within a preset time period into a pending event group and processes the group accordingly. This method specifically includes:

[0087] S201: In response to receiving a group of events to be processed within a preset time period, determine the target controller group corresponding to the group of events to be processed.

[0088] The pending event group includes multiple pending events received within a preset time period; the target controller group includes all target controllers corresponding to the pending events in the pending event group.

[0089] The manager can group multiple pending events received within a preset time period (such as a work cycle) into a pending event group. After determining the target controller corresponding to each pending event in the pending event group, the manager can group all the target controllers corresponding to each pending event in the pending event group into a target controller group.

[0090] S202: Wake up all target controllers in the target controller group, so that each target controller in the target controller group can perform data operations corresponding to its corresponding pending events.

[0091] The manager can wake up the corresponding target controller in the order of the pending events received in the pending event group, so that the target controller can perform the data operation corresponding to the pending event.

[0092] In one optional embodiment of this disclosure, in response to receiving a group of events to be processed within a preset time period, determining the target controller group corresponding to the group of events to be processed may include: in response to receiving a group of events to be processed within a preset time period, performing deduplication processing on the group of events to be processed; and determining the target controller group corresponding to the group of events to be processed based on at least one target controller corresponding to each event to be processed in the deduplicated group of events to be processed.

[0093] Among them, deduplication of the event group to be processed can be performed by preventing the target controller corresponding to the event from going to sleep after the first wake-up of the target controller corresponding to the event to be processed when there are the same events in the event group, until all data operations corresponding to the same event to be processed are completed.

[0094] By deduplicating the event groups to be processed, the frequent waking of the target controller is avoided, thus reducing the waste of resources caused by the frequent waking of the target controller.

[0095] In some specific implementations, the manager can merge all identical events within a work cycle into one event by responding to a group of pending events received within a preset time period and merging the identical events among multiple pending events received within the preset time period to generate a pending event group.

[0096] The method of determining the target controller group corresponding to the event group based on at least one target controller corresponding to each event in the event group only wakes up the corresponding controller once.

[0097] In one optional embodiment of this disclosure, in response to receiving a group of events to be processed within a preset time period, determining the target controller group corresponding to the group of events to be processed includes: in response to receiving a group of events to be processed within a preset time period, determining that all target controllers corresponding to the events to be processed in the group of events to be processed constitute an initial target controller group; performing deduplication processing on the target controllers in the initial target controller group to generate the target controller group corresponding to the group of events to be processed.

[0098] The deduplication process for the initial target controller group can be performed by, in the case of identical target controllers in the initial target controller group, keeping the target controller in a non-sleep state after the first wake-up of the target controller until all data operations corresponding to the pending events in all pending event groups are completed.

[0099] By deduplicating the initial target controller group, we can also avoid the target controllers being frequently woken up, thus reducing the waste of resources caused by frequent wake-ups of the target controllers.

[0100] In some specific implementations, by merging the same target controllers among all the target controllers corresponding to the events to be processed, a target controller can be woken up only once if it needs to be woken up multiple times by multiple events within a working cycle.

[0101] The manager takes all pending events received within a preset time period as a pending event group. When processing pending event groups, if the manager and the server are running the same process or the same binary program, the manager can also obtain pending events sent by the server through a channel. That is, the server sends pending events to the controller manager through a channel.

[0102] A channel is a method of inter-process communication. It is essentially a memory buffer. Through a channel, the output of one module can be obtained by modules running in the same process.

[0103] When the manager and server are running in the same process, the server's output (such as pending events) can be accessed by the manager.

[0104] When the manager and the server are running different processes, or different binary programs, the manager can obtain pending events sent by the server through inter-process communication. In other words, the server sends pending events to the controller manager through inter-process communication.

[0105] Regardless of whether the manager and the server are running different processes, the server can send pending events to the database. The event-sync controller in the controller manager will scan the database at predetermined intervals (such as every second or every minute) based on a timer, and send the pending events in the database to the controller manager through a channel.

[0106] In one alternative approach of this disclosure, the manager determines the number of events generated by different servers within a preset time period based on the pending events received within that time period. Servers that generate events too frequently will have their traffic controlled and blocked. The specific blocking strategy can be a token bucket mechanism. This disclosure does not restrict the specific blocking strategy.

[0107] In one alternative embodiment of this disclosure, in response to receiving at least one pending event sent by the server, each pending event is matched with a preset rule set corresponding to multiple controllers to determine at least one target controller corresponding to each pending event.

[0108] In some implementations, each controller registers a set of rules it is interested in. These rule sets represent the matching relationships between controllers and events, and the matching relationships can be expressed using regular expressions. The matching function is `regexp.MatchString` in Go. The controller manager continues to match the URL (Uniform Resource Locator) of the pending event received from the server with each controller's rule set. The matched controllers determine the controller that needs to be woken up, i.e., the target controller corresponding to that pending event.

[0109] In the method provided in this embodiment, the manager acquires the events to be processed within a working cycle and groups them into a group of events to be processed. This facilitates the merging and other processing of repeated events to be processed, avoids the waste of CPU resources caused by the controller being repeatedly woken up, and further reduces the amount of CPU used and the pressure on the database while ensuring the timeliness of data operations.

[0110] Figure 3 This is a flowchart illustrating a method for waking up a controller according to an embodiment of this disclosure, applied to a server. Figure 3 As shown, this method mainly includes:

[0111] S301: Generate events to be processed based on the data operations to be performed.

[0112] The server can be a user server or any program or tool that can communicate with the controller manager.

[0113] S302: Send the pending event to the manager so that the manager can determine at least one target controller corresponding to the pending event and wake up all target controllers so that the target controllers can perform the data operation to be performed.

[0114] Based on the operation request, the server determines the data operation to be executed and generates events to be processed.

[0115] If a user sends a request to the server to perform an operation on data in the database, such as adding, deleting, modifying, or querying data, the server generates a pending event corresponding to the operation request.

[0116] In some implementations, the server's HTTP middleware contains an interceptor that intercepts user requests. If the HTTP business logic actively constructs a pending event, the interceptor forwards it to the manager; otherwise, it constructs and sends the event to the manager according to default rules.

[0117] In some possible implementations, the manager can be a controller manager, used to wake up the controllers it manages, and to control the controllers it manages to perform data operations.

[0118] In the method provided in this embodiment, the server generates a pending event based on the data operation to be performed and sends the pending event to the manager so that the manager can wake up the controller based on the pending event. The manager wakes up the controller corresponding to the pending event after receiving the pending event, which can ensure the timeliness of data operation completion.

[0119] Meanwhile, the manager wakes up the controller corresponding to the event to be processed. Controllers that do not participate in data operations will not be woken up. This reduces CPU usage and lowers the pressure on the database while ensuring the timeliness of data operations.

[0120] In one alternative embodiment of this disclosure, when the manager and the server are running the same process, or the same binary program, the server sends pending events to the controller for management via a channel.

[0121] In one alternative embodiment of this disclosure, when the manager and the server are running different processes, or different binary programs, the events to be processed are sent to the manager via inter-process communication.

[0122] Inter-process communication includes, but is not limited to, MQ (Message Queue), TCP (Transmission Control Protocol) / UDP (User Datagram Protocol) communication protocols, MySQL (Relational Database Management System), and Redis (Remote Dictionary Server).

[0123] Sending pending events to the manager via a channel is faster than sending them via inter-process communication. Events sent via a channel have a timeliness in the nanosecond (ns) range; events sent via inter-process communication have a timeliness in the second (s) range.

[0124] The timeliness of the pending event is the time interval between the server generating the event and the manager waking up the corresponding controller.

[0125] Whether the pending events are sent to the manager via channel or inter-process communication, the events are sent directly to the manager without the need for database involvement, making it more convenient.

[0126] In one alternative approach disclosed herein, regardless of whether the manager and the server are running different processes, the server can send pending events to the database, and the event-sync controller in the manager will scan the database at predetermined intervals (such as every second, every minute, etc.) based on a timer, and send the pending events in the database to the manager through a channel.

[0127] In other words, before determining at least one target controller corresponding to a pending event in response to a pending event sent by the server, the process may include a step of scanning the database at predetermined intervals to obtain pending events sent by the server to the database.

[0128] Sending pending events to the database is equivalent to creating a queue of pending events in the database, which allows the controller manager to read multiple pending events at once and process them centrally.

[0129] Figure 4 This is a schematic diagram of a specific embodiment of a method for waking up a controller provided in this disclosure. For example... Figure 4 As shown, this method is specifically used in the controller manager, and the method may include:

[0130] Server, Force Update, and Others generate pending events and can directly send these events to the Controller Manager. In other words, when Server, Force Update, Others, and the Controller Manager are running in the same process or the same binary, Server, Force Update, Others, and the Controller Manager send pending events to the Controller Manager via a channel.

[0131] When the controller manager and the server, forced updates, other programs or tools are running different processes, or different binaries, the server sends pending events to the controller manager through inter-process communication.

[0132] Servers and forced updates can also send pending events to the database, which in turn sends pending events to the controller manager. Specifically, servers and forced updates send pending events to the database, and the event-sync controller in the controller manager scans the database at predetermined intervals (such as every second or every minute) based on a timer, and sends the pending events in the database to the controller manager through a channel.

[0133] The controller manager determines the target controller based on the pending events and wakes up the target controller from among the many controllers it controls (such as pipeline controllers, native program controllers, other controllers, etc.).

[0134] Meanwhile, the intelligent analysis module of the controller manager obtains the inactivity duration of unwakeable controllers at preset intervals; if the inactivity duration of an unwakeable controller exceeds the preset maximum inactivity duration for that controller, the controller manager wakes up that controller.

[0135] The awakened controller performs corresponding data operations based on the content of the event to be processed.

[0136] Figure 5 This is a schematic diagram of a specific embodiment of another method for waking up a controller provided in this disclosure. For example... Figure 5 As shown, this method can also be used in the controller manager, and it mainly includes:

[0137] A user sends a request to the server to perform operations on data in the database. These operations include adding, deleting, modifying, and querying data.

[0138] The server's HTTP midware contains an interceptor for a frequency converter. This interceptor intercepts user operation requests. If the HTTP business logic actively constructs a pending event, the interceptor forwards the event to the controller manager; otherwise, the interceptor constructs and sends the event to the controller manager according to default rules.

[0139] In this context, interceptors can send events to the controller manager, or they can send pending events to the event bus (event stack). Alternatively, the controller can actively trigger pending events and send them to the event bus.

[0140] The event-sync controller in the controller manager scans the event bus at predetermined intervals (such as every second or every minute) based on the timer of the frequency converter control center, and sends the pending events in the event bus to the decision-maker through the channel.

[0141] The decision-maker can perform event merging, flow control, rule matching, and instruction distribution on multiple received pending events.

[0142] Event merging can combine identical events from multiple received pending events, that is, all identical events within a work cycle are merged into one event, waking up the corresponding controller only once.

[0143] Event merging can also be included in situations where a controller may need to be woken up multiple times by multiple events within a single work cycle. In such cases, the decision-maker can merge these events and wake up the controller only once.

[0144] Flow control can be achieved by obtaining the server's identifier and intercepting pending events when the number of pending events sent by the server within a preset time period exceeds a preset threshold.

[0145] In other words, the decision-maker determines the number of events generated by different servers within a preset time period based on the pending events received within that time period. Servers that generate events too frequently will have their traffic controlled and be blocked. The specific blocking strategy can be a token bucket mechanism. This disclosure does not restrict the specific blocking strategy.

[0146] Simultaneously, each controller, such as the pipeline controller, application controller, Kubernetes resource controller, Export / import controller, and DKE controller, registers a set of rules of interest with the controller manager. These rule sets represent the matching relationships between controllers and events, and the matching relationships support regular expression strings. The matching function is Go's `regexp.MatchString`. The decision maker continues to match the URL (Uniform Resource Locator) of the pending event received from the server with each controller's rule set to determine which controller needs to be woken up.

[0147] After identifying the controller that needs to be woken up, the controller manager generates a wake-up command to wake up the target controller.

[0148] Meanwhile, the intelligent analysis module of the controller manager obtains the inactivity duration of unwakeable controllers at preset intervals; if the inactivity duration of an unwakeable controller exceeds the preset maximum inactivity duration for that controller, the controller manager wakes up that controller.

[0149] The awakened controller performs corresponding data operations based on the content of the event to be processed.

[0150] Based on and Figure 1 The method shown follows the same principle. Figure 6 This is a schematic diagram of the structure of a wake-up controller device provided in an embodiment of this disclosure, as shown below. Figure 6 As shown, the wake-up controller device 60 can be applied to a manager and may include:

[0151] The controller module 610 is configured to, in response to receiving at least one pending event sent by the server, determine at least one target controller corresponding to each pending event; the target controller is configured to perform data operations corresponding to its pending event.

[0152] The wake-up controller module 620 is used to wake up all target controllers corresponding to at least one pending event, so that each target controller can perform the data operation corresponding to its pending event.

[0153] The device for waking up controllers provided in this disclosure wakes up controllers based on pending events, ensuring the timeliness of data operation completion. Simultaneously, since only the controller corresponding to the pending event is woken up, controllers not involved in data operations are not woken up, reducing CPU usage and database pressure while ensuring the timeliness of data operations. Furthermore, each controller is only woken up when there is a data operation to be performed; it is no longer woken up at a fixed frequency but flexibly woken up according to demand.

[0154] In one optional embodiment of this disclosure, the controller module 610 is further configured to determine the target controller group corresponding to the event group in response to receiving a group of events to be processed within a preset time period; wherein, the event group to be processed includes multiple events to be processed received within the preset time period; and the target controller group includes all target controllers corresponding to the events to be processed in the event group to be processed.

[0155] The wake-up controller module 620 is also used to wake up all target controllers in the target controller group, so that each target controller in the target controller group can perform data operations corresponding to its corresponding pending events.

[0156] The step of receiving a group of events to be processed within a preset time period and determining the target controller group corresponding to the group of events to be processed includes: receiving a group of events to be processed within a preset time period and performing deduplication processing on the group of events to be processed; and determining the target controller group corresponding to the group of events to be processed based on at least one target controller corresponding to each event to be processed in the deduplicated group of events to be processed.

[0157] In response to receiving a group of events to be processed within a preset time period, determining the target controller group corresponding to the group of events to be processed, may further include: in response to receiving a group of events to be processed within a preset time period, determining that all target controllers corresponding to each event to be processed in the group of events to be processed form an initial target controller group; performing deduplication processing on the target controllers in the initial target controller group to generate the target controller group corresponding to the group of events to be processed.

[0158] In one alternative embodiment of this disclosure, the controller module 610 is further configured to: in response to receiving a pending event sent by the server, obtain the server's identifier, and intercept the pending event if the number of pending events sent by the server within a preset time period exceeds a preset threshold.

[0159] In one alternative embodiment of this disclosure, the controller determination module 610 is further configured to: in response to receiving at least one pending event sent by the server, match each pending event with a preset rule set corresponding to a plurality of controllers, and determine at least one target controller corresponding to each pending event.

[0160] In one optional embodiment of this disclosure, the controller manager 60 further includes a timed monitoring module, used to obtain the inactivity duration of unwakeable controllers at preset intervals; and to wake up a controller if the inactivity duration of an unwakeable controller exceeds the preset maximum inactivity duration corresponding to that controller.

[0161] In one alternative embodiment of this disclosure, the controller manager 60 further includes a receiving module for scanning the database at predetermined intervals to obtain pending events sent to the database by the server.

[0162] In one alternative embodiment of this disclosure, the receiving module can also be used to obtain the pending event through a channel when the server sending the pending event and the controller manager are running the same process; or to obtain the pending event through inter-process communication when the server sending the pending service and the controller manager are running different processes.

[0163] In one alternative embodiment of this disclosure, the wake-up controller module 620 may also be used to generate a wake-up command corresponding to each target controller; send the wake-up command to the corresponding target controller to wake up the target controller, so that the target controller performs data operations corresponding to its corresponding pending event.

[0164] Based on and Figure 3 The method shown follows the same principle. Figure 7 This is a schematic diagram of a wake-up controller device provided in an embodiment of this disclosure. This wake-up controller device is applied to a server, such as... Figure 7 As shown, the wake-up controller device 70 may include:

[0165] The generation module 710 is used to generate events to be processed based on the data operations to be performed.

[0166] The sending module 720 is used to send the event to be processed to the manager, so that the manager can determine at least one target controller corresponding to the event to be processed, and wake up all target controllers so that the target controllers can perform the data operation to be performed.

[0167] The server provided in this embodiment generates pending events based on the data operations to be performed and sends these pending events to a manager. This allows the manager to wake up controllers based on the pending events. The manager wakes up the controller corresponding to the pending event only after receiving it, ensuring the timeliness of data operation completion. Furthermore, the manager only wakes up the controller corresponding to the pending event; controllers not involved in data operations are not woken up. This reduces CPU usage and lowers database pressure while maintaining the timeliness of data operations.

[0168] In one alternative embodiment of this disclosure, the sending module 720 may also be used to send pending events to the database, so that the manager scans the database at predetermined intervals to obtain pending events sent to the database by the server.

[0169] In one alternative embodiment of this disclosure, the sending module 720 can also be used to send the event to be processed to the manager via a channel when the server and the manager are running the same process; or to send the event to be processed to the manager via inter-process communication when the server and the manager are running different processes.

[0170] Based on and Figure 1 , 3 The method shown follows the same principle. Figure 8 This is a schematic diagram of the structure of a wake-up controller system provided in an embodiment of this disclosure.

[0171] According to embodiments of this disclosure, this disclosure also provides a system for waking up a controller, the system comprising:

[0172] A manager for performing the methods provided in this disclosure for waking up a controller;

[0173] A server for use with the wake-up controller method applied to a server provided in this disclosure.

[0174] The system for waking up controllers provided in this disclosure generates pending events based on the data operations to be performed and sends these pending events to a manager. This allows the manager to wake up controllers based on the pending events. The manager wakes up the controller corresponding to the pending event only after receiving it, ensuring the timeliness of data operation completion. Furthermore, the manager only wakes up the controller corresponding to the pending event; controllers not involved in data operations are not woken up. This reduces CPU usage and lowers database pressure while maintaining the timeliness of data operations.

[0175] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with relevant laws and regulations and do not violate public order and good morals.

[0176] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0177] Figure 9 This is a schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0178] like Figure 9As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or a computer program loaded into random access memory (RAM) 903 from storage unit 908. RAM 903 may also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.

[0179] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0180] The computing unit 901 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as a method for waking up a controller for a controller manager. For example, in some embodiments, the method for waking up a controller for a controller manager can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the method for waking up the controller described above can be performed. Alternatively, in other embodiments, the computing unit 901 can be configured to perform a method to wake up the controller by any other suitable means (e.g., by means of firmware).

[0181] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.

[0182] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0183] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0184] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0185] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0186] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0187] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0188] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for waking up a controller, applied to a manager, comprising: In response to receiving at least one pending event sent by the server, at least one target controller corresponding to each pending event is determined; The target controller is used to perform data operations corresponding to its corresponding pending events; Wake up all target controllers corresponding to the at least one pending event, and enable each target controller to perform the data operation corresponding to its pending event. The step of determining at least one target controller corresponding to each pending event in response to receiving at least one pending event sent by the server includes: In response to receiving at least one pending event sent by the server, each pending event is matched with a preset rule set corresponding to multiple controllers to determine at least one target controller corresponding to each pending event; The step of waking up all target controllers corresponding to the at least one pending event, and causing each target controller to execute the data operation corresponding to its pending event, includes: Generate wake-up instructions for each target controller; The wake-up command is sent to the corresponding target controller to wake up the target controller, so that the target controller can perform data operations corresponding to the event to be processed.

2. The method according to claim 1, wherein, The step of determining at least one target controller corresponding to each pending event in response to receiving at least one pending event from the server includes: In response to receiving a group of pending events within a preset time period, the system determines the target controller group corresponding to the group of pending events; wherein, the group of pending events includes multiple pending events received within the preset time period; and the target controller group includes all target controllers corresponding to the pending events in the group of pending events. The step of waking up all target controllers corresponding to the at least one pending event, and causing each target controller to execute the data operation corresponding to its pending event, includes: Wake up all target controllers in the target controller group, and enable each target controller in the target controller group to perform data operations corresponding to its corresponding pending event.

3. The method according to claim 2, wherein, The response, which involves receiving a group of events to be processed within a preset time period and determining the target controller group corresponding to the group of events to be processed, includes: In response to receiving a group of events to be processed within a preset time period, the group of events to be processed is deduplicated. The target controller group corresponding to the event group is determined based on at least one target controller corresponding to each event in the event group after deduplication.

4. The method according to claim 2, wherein, The response, which involves receiving a group of events to be processed within a preset time period and determining the target controller group corresponding to the group of events to be processed, includes: In response to receiving a group of pending events within a preset time period, determine that all target controllers corresponding to the pending events in the group of pending events form an initial target controller group; The target controllers within the initial target controller group are deduplicated to generate the target controller group corresponding to the event group to be processed.

5. The method according to claim 1, wherein, The method further includes: In response to receiving at least one pending event sent by the server, determine the number of pending events sent by the server within a preset time period; If the number of events exceeds a preset threshold, the server will be intercepted.

6. The method according to claim 1, wherein, The method further includes: Get the inactivity duration of unwakeable controllers at preset intervals; If a controller that has not been woken up has been idle for a period of time exceeding the preset maximum idle time for that controller, then that controller will be woken up.

7. The method according to claim 1, wherein, Before determining at least one target controller corresponding to each pending event in response to receiving at least one pending event from the server, the method further includes: The database is scanned at predetermined intervals to retrieve pending events sent from the server.

8. The method according to claim 1, wherein, Before determining at least one target controller corresponding to each pending event in response to receiving at least one pending event from the server, the method further includes: When the server sending the pending event is running the same process as the manager, the pending event is obtained through a channel; When the server sending the event to be processed and the manager are running different processes, the event to be processed is obtained through inter-process communication.

9. A method for waking up a controller, applied to a server, comprising: Based on the data operations to be performed, generate events to be processed; The pending event is sent to the manager, so that the manager matches the pending event with a preset rule set corresponding to multiple controllers, determines at least one target controller corresponding to the pending event, generates a wake-up command for each target controller, and sends the wake-up command to the corresponding target controller to wake up all the target controllers, so that the target controllers can execute the pending data operation.

10. The method according to claim 9, wherein, Sending the event to be processed to the manager includes: The pending events are sent to the database so that the manager scans the database at predetermined intervals to obtain the pending events sent to the database by the server.

11. The method according to claim 9, wherein, Sending the event to be processed to the manager includes: When the server and the manager are running in the same process, the event to be processed is sent to the manager via a channel; When the server and the controller manager are running different processes, the pending events are sent to the manager via inter-process communication.

12. An apparatus for waking up a controller, applied to a manager, comprising: The controller determination module is configured to determine at least one target controller corresponding to each pending event in response to receiving at least one pending event sent by the server. The target controller is used to perform data operations corresponding to its corresponding pending events; The wake-up controller module is used to wake up all target controllers corresponding to the at least one pending event, so that each target controller can perform the data operation corresponding to its corresponding pending event. Specifically, the controller determination module is used for: In response to receiving at least one pending event sent by the server, each pending event is matched with a preset rule set corresponding to multiple controllers to determine at least one target controller corresponding to each pending event; Specifically, the wake-up controller module is used for: Generate wake-up instructions for each target controller; The wake-up command is sent to the corresponding target controller to wake up the target controller, so that the target controller can perform data operations corresponding to the event to be processed.

13. A wake-up controller apparatus, applied to a server, comprising: The generation module is used to generate events to be processed based on the data operations to be performed. The sending module is used to send the event to be processed to the manager, so that the manager matches the event to be processed with a preset rule set corresponding to multiple controllers, determines at least one target controller corresponding to the event to be processed, generates a wake-up instruction for each target controller, and sends the wake-up instruction to the corresponding target controller to wake up all the target controllers, so that the target controllers can perform the data operation to be executed.

14. A system for a wake-up controller, comprising: Manager, the manager being configured to perform the method of waking up the controller as described in any one of claims 1-8; A server, the server being used to perform the wake-up controller method according to any one of claims 9-11.

15. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-8, or the method of any one of claims 9-11.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-8, or to perform the method according to any one of claims 9-11.

17. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-8, or implements the method according to any one of claims 9-11.