Event push method, device, storage medium and program product

By increasing the aggregation window in the microservice system to reduce the number of aggregation events, the excessive consumption of memory resources caused by frequent push of configuration information during the large-scale release of microservices is solved, and the system stability is improved.

CN119225982BActive Publication Date: 2025-04-25ALIBABA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411754619.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-04-25
Estimated Expiration
2044-12-02

AI Technical Summary

Technical Problem

During the process of large-scale release of microservices, frequent push of configuration information leads to excessive consumption of memory resources of the control nodes, and may occur OOM, affecting system stability.

Method used

By responding to memory protection trigger events during the push of aggregation event, the actual usage information of the target memory resource is obtained, and the aggregation window is increased based on the actual usage information, so as to reduce the number of aggregate events obtained by the aggregation process and the number of calculations of context information, thereby reducing the consumption of memory resources.

Benefits of technology

It effectively reduces the consumption of memory resources by pushing aggregation event, reduces the probability of OOM, and improves the stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119225982B_ABST
    Figure CN119225982B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide an event push method, device, storage medium and program product. In this method, the target event can be aggregated to obtain an aggregate event, and the event is pushed with the aggregate event as the granularity; a memory protection trigger event and a memory protection mechanism are added for the memory resources used to push the aggregate event, and the memory protection mechanism is executed when the memory protection trigger event occurs to protect the memory resources and reduce the probability of OOM, that is, the aggregation window is increased according to the actual usage information of the memory resources, and the target event is aggregated and pushed using the increased aggregation window. Among them, the aggregation window can be reasonably increased based on the actual usage information of the memory resources. As the aggregation window increases, the number of events whose receiving time falls into the aggregation window increases, and the number of aggregate events decreases, thereby reducing the number of context information calculations, thereby reducing the memory resource consumption of the pushed event and the probability of OOM, and improving system stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to an event push method, device, storage medium and program product. Background Art

[0002] Service Mesh is a way to handle service communication in a microservice architecture. It provides intelligent traffic management, security, and observability, and is designed to simplify the complexity of inter-service communication. It is widely used in the field of cloud computing. For example, by combining a cloud native gateway with a service mesh, proxy nodes are injected into each service node where a gateway service is deployed. Communication control such as load balancing and fault recovery is achieved between service nodes through proxy nodes. Service nodes do not need to pay attention to communication details and can focus more on the development of service logic.

[0003] The service grid is logically divided into a data plane and a control plane. The data plane is mainly composed of proxy nodes to coordinate and control network communications between service nodes; the control plane is mainly composed of control nodes to manage proxy nodes and send various configuration information to proxy nodes. In large-scale cluster scenarios such as PAI (Platform for AI), there are many services, and each service is usually deployed on multiple service nodes, which leads to a large number of proxy nodes. It may be necessary to deploy multiple large-scale (for example, 3 processor cores and 16G memory) control nodes to meet the configuration information push requirements. Furthermore, in the process of large-scale release of microservices, the configuration information will be pushed more frequently, which will consume a large amount of resources of the control node, especially memory resources, and may cause OOM (Out Of Memory) frequently, affecting the stability of the overall system. Summary of the invention

[0004] Multiple aspects of the present application provide an event push method, device, storage medium and program product to reduce the consumption of memory resources by pushing events, reduce the probability of OOM, and improve system stability.

[0005] An embodiment of the present application provides an event pushing method for pushing aggregate events to a dynamically variable number of target nodes, wherein the aggregate events are aggregated by target events whose receiving time falls within an aggregation window, and the method comprises: in a process of pushing aggregate events, in response to the occurrence of a memory protection triggering event, obtaining actual usage information of target memory resources, wherein the target memory resources are memory resources used for pushing aggregate events; if it is determined that memory protection needs to be triggered based on the actual usage information of the target memory resources, increasing the aggregation window; aggregating target events whose receiving time falls within the increased aggregation window to obtain aggregate events; and when the aggregate events are scheduled, pushing the aggregate events to currently existing target nodes based on available memory resources in the target memory resources.

[0006] An embodiment of the present application also provides a service grid system, including: a control node and a dynamically variable number of proxy nodes, wherein the proxy nodes are deployed in the service nodes of the microservice system; the control node is used to push aggregate events to the proxy nodes, wherein the aggregate events are aggregated by target events whose receiving time falls within an aggregation window; and in the process of pushing aggregate events, in response to the occurrence of a memory protection trigger event, obtaining actual usage information of a target memory resource, wherein the target memory resource is a memory resource used by the control node to push the aggregate event; if it is determined that memory protection needs to be triggered based on the actual usage information of the target memory resource, then the aggregation window is increased, and the target events whose receiving time falls within the increased aggregation window are aggregated to obtain an aggregate event, and when the aggregate event is scheduled, the aggregate event is pushed to the currently existing proxy node based on the available memory resources in the target memory resource.

[0007] An embodiment of the present application also provides an electronic device, comprising: a memory and a processor; the memory is used to store a computer program, and the processor is coupled to the memory and is used to execute the computer program to implement the steps in the event pushing method.

[0008] An embodiment of the present application also provides a computer-readable storage medium, including a computer program / instruction. When the computer program / instruction is executed by a processor, the processor is enabled to implement the steps in the event pushing method.

[0009] An embodiment of the present application also provides a computer program product, including a computer program / instruction. When the computer program / instruction is executed by a processor, the processor is enabled to implement the steps in the event pushing method.

[0010] In this embodiment, during the aggregation event push process, in response to the occurrence of a memory protection trigger event, the actual usage information of the target memory resources can be obtained; if it is determined that memory protection needs to be triggered based on the actual usage information of the target memory resources, the aggregation window is increased; the target events whose receiving time falls within the increased aggregation window are aggregated to obtain an aggregation event; when the aggregation event is scheduled, the aggregation event is pushed to the currently existing target node based on the available memory resources in the target memory resources. In this way, the aggregation window can be reasonably increased based on the actual usage information of the target memory resources to increase the number of target events whose receiving time falls within the aggregation window, thereby reducing the number of aggregation events obtained by the aggregation process, thereby reducing the number of calculations of the context information involved, and reducing the consumption of memory resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0012] Figure 1a A schematic diagram of the structure of the Istio push architecture provided for an exemplary embodiment of the present application;

[0013] Figure 1b Another structural diagram of the Istio push architecture provided by an exemplary embodiment of the present application;

[0014] Figure 2a A flowchart of an event push method provided by an exemplary embodiment of the present application;

[0015] Figure 2b A schematic diagram of a fitting curve between the number of services and the number of Pods and memory provided in an exemplary embodiment of the present application;

[0016] Figure 2c A schematic diagram of a fitting curve between the number of routes and memory provided by an exemplary embodiment of the present application;

[0017] Figure 2d A schematic diagram of a fitting curve between the number of domain names and memory provided by an exemplary embodiment of the present application;

[0018] Figure 2e A schematic diagram of an event push system provided for an exemplary embodiment of the present application;

[0019] Figure 3 A schematic diagram of an event push system in an actual application scenario provided by an exemplary embodiment of the present application;

[0020] Figure 4A schematic diagram of an event counter provided for an exemplary embodiment of the present application;

[0021] Figure 5 A schematic diagram of a memory predictor provided for an exemplary embodiment of the present application;

[0022] Figure 6 A schematic diagram of a window dynamic adjuster provided by an exemplary embodiment of the present application;

[0023] Figure 7-Figure 9 A schematic diagram of the overall push process in an actual application scenario provided by an exemplary embodiment of the present application;

[0024] Fig.10 A schematic diagram of an event push device provided by an exemplary embodiment of the present application;

[0025] Fig.11 A schematic diagram of an electronic device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0027] It should be noted that, in the case of user information involved in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation portals for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) are in compliance with relevant laws and standards.

[0028] At present, in the process of large-scale release of microservices, the push of configuration update events will be more frequent. In the process of pushing configuration update events, the calculation process will be involved. For example, when pushing configuration update events, the context information corresponding to the configuration update events needs to be calculated and saved, which can consume certain memory resources. Among them, the configuration update event is used to describe the changes in microservices due to redeployment, and the context information of the configuration update event refers to the result information generated after the microservice configuration is updated. For example, when the address is updated, the address update event and the updated address information can be sent to the proxy node, and the updated address is the context information corresponding to the address update event; for another example, when the node information is updated, the node update event and the updated node information can be sent to the proxy node, and the updated node information is the context information corresponding to the node update event. In the process of calculating the context information, a large number of intermediate instances and temporary variables will be calculated, which will further increase the consumption of memory resources.

[0029] Let's take an example based on a real scenario: In a real scenario, a user may have many microservices. Based on load balancing and traffic pressure dispersion, each microservice can be deployed on multiple proxy nodes. When a microservice is redeployed, the configuration information can be updated, so it is necessary to send configuration update events and corresponding context information to the proxy node. Since the configuration information related to the microservice will change with the redeployment, such as routing information, current limiting and fuse policy information configured on the route, more configuration update events need to be pushed to the proxy node with the redeployment of the microservice. If there are many configuration update events that need to be pushed within a period of time, memory resources will be over-consumed in a short period of time, and OOM may occur. In addition, since the configuration update events are pushed in full, when the configuration update events are pushed multiple times, the pushed configuration update events will definitely be repeated, which means that the calculation of some configuration update events is repeated, and each repeated calculation will repeatedly waste memory resources, thereby further increasing the consumption of memory resources.

[0030] Therefore, this case proposes a solution to aggregate the events to be pushed and then push them. Through the set aggregation window, the events whose receiving time falls into the aggregation window are aggregated to obtain aggregate events, and then the aggregate events are pushed, thereby reducing the memory consumption caused by repeated calculations during the push process. At the same time, there are some new problems: the process of pushing aggregate events to any proxy node involves the transmission of context information. Since the events and context information are pushed to different proxy nodes as the receiving end, under the microservice architecture, different proxy nodes and the push end may have different networks or different links. Therefore, the number of context information corresponds to the number of proxy nodes, and each piece of context information will occupy memory. In other words, when the number of proxy nodes is multiple, the number of context information also needs to be multiple. When pushing the same aggregate event to multiple proxy nodes, it is necessary to store a copy of the event and context information for each proxy node, which will also lead to memory consumption, and send multiple copies of aggregate events and context information to multiple proxy nodes respectively.

[0031] The following is an example of applying the above solution to a service grid system, which can be but is not limited to Istio. Figure 1a As shown in the figure, the event push architecture of the service grid system is set with a three-level cache and uses the xDS transmission protocol or other transmission protocols for event transmission. The xDS (X Discovery Service) protocol is a set of service discovery protocols. Based on the xDS protocol, configuration update events can be transmitted between proxy nodes and service management terminals to achieve dynamic configuration updates in the service grid without restarting the service. When the configuration of any service is updated, a configuration update event will be generated and sent to the push channel.

[0032] When a configuration update event arrives, it will first wait in the push channel and enter the aggregation function (such as the Debounce aggregation function) one by one for aggregation processing. The Debounce aggregation function can be used to shape multiple consecutively pushed events to avoid performing too many unnecessary operations when multiple events are received in a short period of time, ensuring that the interval between two adjacent event pushes is not too long or too frequent; Optionally, the aggregation window can be set to an upper limit of 10s and a lower limit of 100ms.

[0033] After the aggregation is completed, the push coroutine can be called to push the aggregated event into the push queue, and then the send coroutine can be called to take the aggregated event from the push queue and push it to the push channel of each protocol link. Each push channel corresponds to a proxy node. Specifically, the context information of each aggregated event can be calculated, and then each aggregated event and its context information can be pushed to the push channel of each protocol link. Finally, the push connection coroutine can be called to push each aggregated event and its context information to the corresponding proxy node.

[0034] For ease of understanding, the above process can be abstracted into Figure 1b The model shown, Figure 1b As shown, 1-6 are all push events. These push events are transformed into two real aggregate events M1 and M2 that need to be pushed through the aggregation function, and then pushed to their respective connected proxy nodes by the push connection coroutine.

[0035] It can be seen that the process of pushing each aggregate event to the corresponding proxy node involves the calculation and transmission of context information, such as Figure 1a As shown in the figure, when there are three proxy nodes, the context information of the three aggregated events needs to be calculated and pushed to the three proxy nodes respectively. Each piece of context information will occupy memory, thereby increasing the consumption of memory resources.

[0036] In summary, due to the dynamic variability of proxy nodes, the preset fixed aggregation window can no longer meet the current event push requirements.

[0037] On this basis, the inventor of this case continued to conduct in-depth research and analysis and other creative work, and provided a new solution by changing the innovative ideas: in this solution, firstly, the event aggregation idea is adopted, that is, the target events to be pushed are aggregated to obtain aggregate events, and the events are pushed with aggregate events as the granularity; further, in the process of pushing aggregate events, memory protection trigger events and memory protection mechanisms are added for the memory resources used to push aggregate events. When the memory protection trigger event occurs, the memory protection mechanism is executed to protect the memory resources and minimize the probability of OOM, that is, the actual usage information of the memory resources is obtained, the aggregation window is increased according to the actual usage information of the memory resources, and the target events are aggregated using the increased aggregation window, and then the processed aggregate events are pushed. Among them, the aggregation window can be reasonably increased based on the actual usage information of the memory resources. Due to the increase of the aggregation window, the number of events whose receiving time falls into the aggregation window increases, and the number of aggregate events obtained by the aggregation processing will decrease, thereby reducing the number of context information calculations, thereby reducing the consumption of memory resources for the push events, reducing the probability of OOM, and improving system stability.

[0038] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0039] Figure 2a The flowchart of the event push method provided by an exemplary embodiment of the present application is shown in FIG. The event push method can be used to push aggregate events to a dynamically variable number of target nodes, the target nodes can be any proxy nodes, and the aggregate events can be aggregated by the target events whose receiving time falls within the aggregation window. Figure 2a As shown, the method may include:

[0040] Step 21: During the aggregation event push process, in response to the occurrence of a memory protection trigger event, actual usage information of a target memory resource is obtained, where the target memory resource is the memory resource used to push the aggregation event.

[0041] Step 22: If it is determined that memory protection needs to be triggered according to the actual usage information of the target memory resources, the aggregation window is increased.

[0042] Step 23: Aggregate the target events whose receiving time falls within the enlarged aggregation window to obtain aggregated events.

[0043] Step 24: When an aggregate event is scheduled, the aggregate event is pushed to the currently existing target node based on the available memory resources in the target memory resources.

[0044] The above event push method can be used to push aggregate events to a dynamically variable number of target nodes. The target node refers to the receiving end of the event. Depending on the application scenario, the implementation form of the target node will be different. For example, in a service grid system, the target node can be implemented as a proxy node. For example, in a microservice system, the target node can be implemented as a service node. For example, in a registration configuration management scenario, the target node can be a client node that registers with the registration configuration center.

[0045] Aggregate events can be aggregated by target events whose receiving time falls within the aggregation window. Among them, the target event can be an initial event generated in the application system (such as a service grid system, a microservice system, a registration configuration management system, etc.) to which the target node belongs, such as a configuration update event, an upgrade event, or a notification event, etc. In this embodiment, the target node is associated with a target application, for example, the target node can run the target application or the service corresponding to the target application, or it can be a registration node of the target application, etc.; the target event is an event corresponding to the target application, for example, it can be a notification event for a version upgrade of the target application, a configuration event related to the target application, etc. In the embodiment of the present application, there is a certain correlation between the target events, and the target events can be aggregated based on these correlations, and there is no effect or basically no effect on the execution state of the target node before and after the aggregation of the target event.

[0046] In addition, in the embodiments of the present application, the types of memory protection trigger events are not limited; in some exemplary embodiments, the memory protection trigger events may include at least one of the following: a memory protection period arrival event, a push completion event corresponding to the last push aggregation event, an event in which the memory occupancy rate exceeds a preset threshold, and an event in which the memory usage continues to grow and is not released. Among them, the memory protection period can be set to any period according to actual needs, and this embodiment does not impose any restrictions. Among them, after the last pushed aggregation event is successfully pushed to the target node, the target node can return a response message, and the event that receives the response message is the push completion event corresponding to the last pushed aggregation event.

[0047] During the aggregate event push process, the actual usage information of the target memory resources can be obtained in response to the occurrence of a memory protection trigger event. The target memory resources are the memory resources used to push the aggregate events. The actual usage information is used to describe the usage of memory resources when pushing aggregate events. Optionally, the actual usage information can be the actual usage information when all generated aggregate events have been pushed. It can be the actual amount of memory used or the remaining amount of memory, the actual amount of memory used and the remaining amount of memory, or the percentage of the actual amount of memory used in the total amount of memory.

[0048] Afterwards, it can be determined whether memory protection needs to be triggered based on the actual usage information of the target memory resource. The embodiment of the present application does not limit the specific judgment method. Taking the actual usage information as the actual amount of memory used as an example, in an exemplary embodiment, a first memory amount threshold corresponding to the actual usage information can be preset. When the actual amount of memory used is greater than the first memory amount threshold, it is determined that memory protection needs to be triggered; taking the actual usage information as the remaining amount of memory as an example, in an exemplary embodiment, a second memory amount threshold corresponding to the actual usage information can be preset. When the remaining amount of memory is less than the first memory amount threshold, it is determined that memory protection needs to be triggered. Taking the actual usage information as the percentage of the actual amount of memory used in the total amount of memory as an example, a proportion threshold corresponding to the actual usage information can be preset. When the percentage of the actual amount of memory used in the total amount of memory is greater than the proportion threshold, it is determined that memory protection needs to be triggered.

[0049] Among them, the memory protection mechanism in this embodiment can be understood as a protection mechanism that is activated when a memory overflow is about to occur, which can reduce the memory occupancy rate and thus reduce the probability of memory overflow. If it is determined that memory protection needs to be triggered based on the actual usage information of the target memory resources, the aggregation window can be increased; wherein, the aggregation window has a time length, and the embodiment of the present application does not limit the size of the time length. The aggregation window may have corresponding upper and lower limits, or it may not have corresponding upper and lower limits. The embodiment of the present application does not limit the specific implementation method of increasing the aggregation window, as long as the time length can be increased.

[0050] When it is determined that memory protection does not need to be triggered according to the actual usage information of the target memory resource, the aggregation window can be appropriately reduced to ensure that the aggregation window does not increase indefinitely. This embodiment does not limit the specific implementation method of reducing the aggregation window. For example, the aggregation window can be reset to a default size, or the aggregation window can be reduced according to a default step size, etc.

[0051] After increasing the aggregation window, the number of target events whose receiving time falls into the aggregation window will increase relatively, and the target events whose receiving time falls into the increased aggregation window can be aggregated to obtain an aggregate event. The embodiment of the present application does not limit the specific aggregation processing method. In an exemplary embodiment, the aggregation processing can be performed according to the sequence of the target events. For example, multiple target events have a sequence of execution, and the front target event is the previous event of the subsequent target event. When performing the aggregation processing, the previous event can be skipped and the last target event can be executed. In another exemplary embodiment, repeated target events can be merged into one aggregate event. For example, there are 10 target events in total, of which 5 target events are repeated, and the 5 repeated target events can be merged into one aggregate event. In another exemplary embodiment, the Debounce aggregation function can be called. The Debounce aggregation function is a stream processing function used to limit the frequency of events. Only the last received target event can be retained in the aggregation window, thereby reducing unnecessary processing and resource consumption. In another exemplary embodiment, an API (Application Programming Interface) with aggregation processing function provided by any message stream processing framework such as Apache Kafka (an open source messaging system framework) and Apache Flink (an open source stream processing framework) can be used to aggregate target events whose receiving time falls within the enlarged aggregation window, but this embodiment does not impose any restrictions.

[0052] In this embodiment, the scheduling of aggregate events can be performed by multi-level asynchronous caching or non-multi-level asynchronous caching, and other methods can also be used for scheduling of aggregate events, which is not limited in this embodiment. In the case of multi-level asynchronous caching, multiple aggregate events obtained by the aggregation process can be input into the push queue to wait for scheduling, and then the aggregate events can be scheduled from the push queue and pushed to the corresponding target node. In the case of non-multi-level asynchronous caching, each aggregate event obtained by the aggregation process can be scheduled in real time and pushed to the corresponding target node.

[0053] When an aggregate event is scheduled that is generated by the aggregation of target events that fall into the enlarged aggregation window, the aggregate event can be pushed to the currently existing target node based on the available memory resources in the target memory resources. Since the aggregation window has been adjusted to be larger, the number of target events whose receiving time falls into the aggregation window will increase, thereby reducing the number of aggregate events obtained by aggregation processing based on the aggregation window. When pushing aggregate events to proxy nodes, the number of calculations of the context information involved will also be reduced, thereby reducing the consumption of memory resources for pushing events, thereby reducing the probability of OOM and improving system stability.

[0054] In some exemplary embodiments, step 21 in the aforementioned embodiment, “responding to the occurrence of a memory protection triggering event, obtaining actual usage information of the target memory resource” can be implemented based on the following steps R21-R22:

[0055] Step R21, in response to the occurrence of a memory protection trigger event, predict the average amount of memory consumed by pushing a single aggregate event. The present application embodiment does not limit the specific method of predicting the average amount of memory. For example, the average amount of memory can be predicted based on any of the following implementations.

[0056] In implementation mode one, the target node may be associated with a target application, and the target event is an event corresponding to the target application, wherein the target node may be deployed with all functions of the target application, or may be deployed in a distributed manner to deploy part of the functions of the target application, which is not limited in this embodiment; the target event may be understood as an event that needs to be pushed to the target application. Based on this, the occurrence of a memory protection trigger event may be responded to, and the average amount of memory required to push a single aggregate event may be predicted based on the target application scale information corresponding to the target application at the target moment. The target moment may be any historical moment, such as the last push moment, or the current moment. The target application scale information may be used to describe the memory resource consumption caused by pushing to the target application, at least including the number of objects that need to consume memory resources to push aggregate events at the target moment and the amount of memory consumed. Objects that need to consume memory resources may include: services, nodes, routes, domain names, and the like. For example, the target application scale information may be the number of routes "10" and the amount of memory consumed "20M"; the target application scale information may also be the number of domain names "5" and the amount of memory consumed "15M"; the target application scale information may also be the number of routes "15", the number of domain names "2" and the amount of memory consumed "36M".

[0057] Specifically, the functional relationship between the average amount of memory required to push a single aggregate event and the application scale information of the target application can be obtained. In the functional relationship, the application scale information is the independent variable and the average amount of memory is the dependent variable. The corresponding functional relationship can be obtained by performing linear regression on the average amount of memory required to push a single aggregate event and the application scale information in advance. Substitute the target application scale information into the functional relationship to obtain the average amount of memory required to push a single aggregate event. In this way, the average amount of memory required to push a single aggregate event can be predicted more accurately based on the application scale information of the target application. The following example illustrates the functional relationship in combination with actual scenarios. In the microservice scenario, the following application scale information is usually involved: service information, service size information, number of nodes information, Pod information, routing information, and domain name information; therefore, each type of application scale information and the average amount of memory can be linearly regressed to obtain the functional relationship between each type of application scale information and the average amount of memory, and then the functional relationship between multiple types of application scale information and the average amount of memory can be analyzed and fitted, and finally the following formula 1 is obtained:

[0058]

[0059] in, is the service field size, is the number of services, both of which are service information; is the pod field size, is the number of pods, both are pod information; is the routing field size, is the number of routes, both of which are routing information; The average amount of memory.

[0060] For the specific derivation process of the above functional relationship, please refer to the subsequent embodiments, which will not be repeated here.

[0061] In implementation mode 2, in response to occurrence of a memory protection trigger event, the average amount of memory required to push a single aggregate event can be predicted based on the number of aggregate events pushed within a specified period and the amount of memory consumed by pushing the pushed aggregate events.

[0062] The specified time period may be a period of time that has occurred before, such as any period of time in the last minute, the last half minute, or the last 300 ms. The specified time period may also be a period of time between two historical moments, which is not limited in this embodiment.

[0063] In a preferred implementation, the specified time period may be between two garbage collection operations, so there is no need to consider the change in memory caused by garbage collection, and the difference between the remaining memory at the beginning of the specified time period and the remaining memory at the end of the specified time period can be used as the amount of memory consumed by pushing the pushed aggregate event. If a garbage collection operation occurs within the specified time period, the amount of memory recovered by the garbage collection operation needs to be considered when calculating the amount of memory consumed by pushing the pushed aggregate event, wherein the difference between the remaining memory at the beginning of the specified time period and the remaining memory at the end of the specified time period can be calculated, and the sum of the difference and the amount of memory recovered by the garbage collection operation is used as the amount of memory consumed by pushing the pushed aggregate event. In this way, the possible impact of the garbage collection operation can be taken into account, and the amount of memory consumed by pushing the pushed aggregate event within the specified time period can be calculated more accurately.

[0064] After determining the amount of memory consumed by pushing the pushed aggregate events, the consumed memory can be divided by the number of aggregate events pushed within a specified time period, and the division result can be used as the average amount of memory required to push a single aggregate event; the consumed memory can also be divided by the number of aggregate events pushed within a specified time period, and the division result can be corrected using a preset correction value to obtain the average amount of memory required to push a single aggregate event. This embodiment does not impose any restrictions.

[0065] In this way, the amount of memory consumed by pushing the pushed aggregate events can be determined more accurately, and then combined with the number of aggregate events pushed in a specified time period, the average amount of memory required to push a single aggregate event can be determined more accurately.

[0066] Step R22: Determine whether there are currently any aggregate events to be pushed and the number of aggregate events to be pushed if there are.

[0067] In an optional manner, the event queue where the aggregate event is located can be queried. If the event queue is empty, it means that there is currently no aggregate event to be pushed. If the event queue is not empty, the number of aggregate events to be pushed can be read therefrom.

[0068] In another optional manner, the aggregated events obtained by the aggregation process may be counted to obtain a first count value, and the pushed aggregated events may be counted to obtain a second count value; based on the first count value and the second count value, it is determined whether there are aggregated events to be pushed and the number of aggregated events to be pushed if there are. The event counter may be used to increase by one each time an aggregated event is obtained after an aggregation process is completed, thereby obtaining the first count value; the event counter may also be used to increase by one each time an aggregated event is pushed, thereby obtaining the second count value.

[0069] Among them, if the first count value is greater than the second count value, it means that there are aggregate events to be pushed. In this case, the difference between the first count value and the second count value can be used as the number of aggregate events to be pushed; if the first count value is equal to the second count value, it means that there are no aggregate events to be pushed, that is, all aggregate events have been pushed.

[0070] In the above embodiment, it is necessary to count the aggregate events that have been pushed, which involves the definition of "whether the aggregate event has been pushed". In the embodiment of the present application, for any aggregate event, it is possible to count whether the number of target nodes that received the aggregate event is the same as the number of target nodes that existed when the aggregate event was generated, to determine whether the aggregate event has been pushed; specifically, if the two numbers are the same, it is determined that the aggregate event has been pushed; if the two numbers are different, it can be determined that the aggregate event has not been pushed.

[0071] Further optionally, considering that the number of target nodes is dynamically changing, the communication link with some target nodes may be disconnected, so that it is impossible to accurately determine whether the aggregate event has been pushed. The embodiment of the present application provides an implementation method for this situation, regardless of whether the disconnection occurs, it can accurately determine whether any aggregate event has been pushed. Among them, for any aggregate event, the number of target nodes that exist when the aggregate event is obtained can be recorded as the first number; and after pushing the collection event, the number of target nodes that return the response message is counted as the second number. If the second number is the same as the first number, it means that the aggregate event has been successfully pushed to the corresponding target node. If the second number is the same as the number of currently surviving connections, it can also be determined that the aggregate event is a pushed aggregate event. For example, when a communication link is established with two target nodes, one of the communication links is suddenly disconnected. At this time, the "current number of surviving connections" is 2. If the number of target nodes that return the response message is also 2, it can be determined that the aggregate event is a pushed aggregate event.

[0072] Step R23: If there are currently aggregate events to be pushed, the actual usage information of the target memory resources is determined based on the number of aggregate events to be pushed and the average memory size. If there are currently no aggregate events to be pushed, it means that all aggregate events have been pushed, and the actual usage information of the target memory resources is determined based on the number of aggregate events to be pushed and the average memory size, which is the current usage of the target memory resources.

[0073] It should be noted that the push of aggregate events can be an asynchronous process, which will cause the memory to be in a "false active" state, that is, when a new target event arrives and the new target event is aggregated, if the aggregate event obtained by the previous aggregation process has not yet completed the push, then the current memory usage is not in a real state. Based on this, in step R23, the memory resources required for the aggregate event to be pushed and the memory resources occupied by the aggregate event that has been pushed are taken into account at the same time, so that the actual usage information of the target memory resources can be more accurately determined. Specifically, it can be implemented based on the following methods: First, read the current usage of the target memory resources, which can be read from the memory manager or from the task manager, and this embodiment is not limited. Afterwards, the potential memory amount required to push the aggregate event to be pushed can be calculated based on the number of aggregate events to be pushed and the average memory amount. Among them, the product of the number of aggregate events to be pushed and the average memory amount can be used as the potential memory amount required to push the aggregate event to be pushed; the product of the number of aggregate events to be pushed and the average memory amount can also be corrected by using a preset memory correction value to obtain the potential memory amount required to push the aggregate event to be pushed. Finally, the actual usage of the target memory resources when all existing aggregate events are pushed can be determined based on the current usage and potential memory of the target memory resources as the actual usage information. Among them, all existing aggregate events include aggregate events to be pushed and aggregate events that have been pushed. Therefore, the sum of the current usage and potential memory of the target memory resources can be used as the actual usage of the target memory resources when all existing aggregate events are pushed, that is, the actual usage information. In this way, when the memory appears to be in a "false active" state, the memory resources required by the aggregate events to be pushed and the memory resources occupied by the aggregate events that have been pushed can be taken into account at the same time, so as to more accurately determine the actual usage information of the target memory resources.

[0074] Based on the above steps R21-R23, the occurrence of a memory protection trigger event can be responded to and the average amount of memory required to push a single aggregate event can be more accurately predicted, thereby combining the number of aggregate events to be pushed to more accurately obtain the actual usage information of the target memory resources.

[0075] After obtaining the actual usage information of the target memory resource, it can be further determined whether memory protection needs to be triggered based on the actual usage information. Specifically, it can be determined whether the actual usage of the target memory resource is greater than or equal to the set memory protection threshold based on the actual usage information of the target memory resource. If not, it means that the actual usage of the target memory resource is small and memory protection does not need to be triggered.

[0076] If yes, it means that the actual usage of the target memory resource is large. In this case, it can be determined that memory protection needs to be triggered. Considering that the garbage collection mechanism can perform garbage collection operations when the actual usage of the target memory resource exceeds the garbage collection threshold, thereby reducing the current memory consumption, there is no need to trigger memory protection at this time; therefore, this embodiment can further combine the garbage collection threshold to determine whether memory protection needs to be triggered when the actual usage of the target memory resource is greater than or equal to the set memory protection threshold. Specifically, it can be determined that memory protection needs to be triggered when the actual usage is less than the set garbage collection threshold. Among them, the protection threshold and the garbage collection threshold can be set to any value according to actual needs, and this embodiment is not limited. Optionally, if the actual usage of the target memory resource is greater than or equal to the set garbage collection threshold, a garbage collection operation can be performed on the target memory resource.

[0077] In this way, when judging whether memory protection needs to be triggered, not only the current memory usage is taken into account, but also the possible impact of the garbage collection mechanism is taken into account. Based on the protection threshold and the garbage collection threshold, it can be more accurately judged whether memory protection needs to be triggered.

[0078] If you determine that memory protection needs to be triggered, you can increase the aggregation window in the following optional ways:

[0079] Method 1: Randomly select a correction value, which can be any positive number, and increase the aggregation window based on the correction value. For example, if the original aggregation window has a length of T0 and the randomly selected correction value is 0.1s, then the length of the aggregation window increased based on the correction value is T0+0.1s.

[0080] Method 2: Increase the aggregation window according to the set step size. The step size can be set to any value according to actual needs, such as 500ms, 600ms or 1s, etc. For example, the time length of the original aggregation window is T0, and the step size is 0.2s. Then, each time the aggregation window is increased based on the step size, the time length of the aggregation window can be increased by 0.2s.

[0081] Method 3: Determine the step length according to the correspondence between the preset number of target nodes and the step length and the number of current target nodes, and increase the aggregation window according to the step length.

[0082] Method 4: Determine an adjustment coefficient based on the actual usage information of the target memory resource, and the adjustment coefficient may be greater than 1. The corresponding relationship between the actual usage information of the memory resource and the adjustment coefficient may be preset, and then the adjustment coefficient may be determined based on the corresponding relationship and the actual usage information of the target memory resource. Afterwards, the size of the aggregation window may be adjusted according to the adjustment coefficient to increase the aggregation window.

[0083] Method 5: Determine the adjustment coefficient according to the current number of events to be pushed, and the adjustment coefficient may be greater than 1. The corresponding relationship between the number of events to be pushed and the adjustment coefficient may be preset, and then the adjustment coefficient may be determined based on the corresponding relationship and the current number of events to be pushed. Afterwards, the size of the aggregation window may be adjusted according to the adjustment coefficient to increase the aggregation window.

[0084] The above methods 1 to 5 are only some optional methods for increasing the aggregation window, and the embodiments of the present application do not limit the specific optional methods. In this way, the size of the aggregation window can be increased more accurately.

[0085] Considering that the memory protection operation itself is to reasonably reduce the memory occupancy rate, that is, to reduce the memory usage to increase the available memory resources; in addition to the memory protection operation, there may be other factors that will also cause the memory occupancy rate to decrease. For example, the garbage collection operation can also reduce the memory occupancy rate, or the target application has been reduced in size, resulting in a decrease in the memory capacity it requires.

[0086] Based on this, in some optional embodiments, when a memory protection trigger event occurs, the actual usage information of the target memory resources can be directly obtained, or it can be determined based on the following method whether to respond to the current memory protection trigger event and obtain the actual usage information of the target memory resources, or not to obtain the actual usage information for the time being and wait for the next memory protection trigger event to occur.

[0087] Optionally, it is possible to determine whether the most recent garbage collection operation occurred between the last memory protection triggering event and the current memory protection triggering event based on the execution time of the most recent garbage collection operation. Among them, if the most recent garbage collection operation occurs between the last memory protection triggering event and the current memory protection triggering event, it means that the garbage collection operation has been performed after the last memory protection triggering event, thereby reducing the consumption of memory resources, and there is no need to obtain the actual usage information of the target memory resources and perform memory protection based on the actual usage information. Therefore, if the most recent garbage collection operation occurs between the last memory protection triggering event and the current memory protection triggering event, you can wait for the next memory protection triggering event to occur; if the most recent garbage collection operation does not occur between the last memory protection triggering event and the current memory protection triggering event, you can perform the operation of obtaining the actual usage information of the target memory resources.

[0088] Optionally, it is also possible to determine whether the target application has been scaled down based on the application scale information of the target application at the time of this memory protection triggering event and at the time of the last memory protection triggering event; wherein, if the application scale information of the target application at the time of this memory protection triggering event is less than the application scale information at the time of the last memory protection triggering event, it means that the target application has been scaled down; if the application scale information of the target application at the time of this memory protection triggering event is not less than the application scale information at the time of the last memory protection triggering event, it means that the target application has not been scaled down. Based on this, if the target application has been scaled down, you can wait for the next memory protection triggering event to occur; if the target application has not been scaled down, you can perform an operation to obtain the actual usage information of the target memory resources.

[0089] Optionally, based on the execution time of the most recent garbage collection operation, determine whether the most recent garbage collection operation occurred between the last memory protection trigger event and the current memory protection trigger event; based on the application scale information of the target application at the time of the current memory protection trigger event and the time of the last memory protection trigger event, determine whether the target application has been reduced in scale; if the judgment results of all judgment operations are no, execute an operation to obtain actual usage information of the target memory resources; if the judgment results of all judgment operations are not no, wait for the next memory protection trigger event to occur.

[0090] Through the above optional methods, it is possible to more accurately determine whether to respond to the current memory protection trigger event and obtain the actual usage information of the target memory resources, or not to obtain the actual usage information for the time being and wait for the next memory protection trigger event to occur, thereby more accurately selecting the timing of memory protection and avoiding performance problems caused by over-optimization of memory resources.

[0091] The specific derivation process of “the functional relationship between the average amount of memory consumed for pushing a single aggregate event and the application scale information of the target application” in the aforementioned embodiment will be described in detail below.

[0092] First, a one-dimensional linear memory estimation algorithm strategy can be constructed, as shown in the following formula 2:

[0093]

[0094] in, , … They are all one-dimensional fitting parameters, and the approximate true parameter values ​​need to be obtained through the following fitting experiments:

[0095] (1) Relationship between the number of services and memory

[0096] Service-related configuration data needs to be added to the memory of the control node (or control node) responsible for event push. These configuration data include but are not limited to: service source configuration data and service configuration data. Service source configuration data includes but is not limited to: identification information and address information of the system or cluster to which the service belongs, which is mainly used to describe which system or cluster the service comes from; service configuration data includes information related to the service itself, such as service identification, type, etc. These configuration data will occupy memory and are related to the number of services and the number of Pods deployed with the service. Specifically, there are the following situations:

[0097] Assume that the initial memory is 149MB, and the number of services: number of Pods = 1:1. Note: In the following tables, Yaml is a file format, and the relevant configuration data is submitted to the control node or control node in the form of a Yaml file. The size of each Yaml file is expressed in bytes; in addition, the total increased memory is the difference between the memory after adding the service configuration data and the initial memory:

[0098]

[0099] Assume that the initial memory is 166M, and the number of services: number of Pods = 1:2. The relevant configuration data that needs to be added to the memory of the control node (or control node) responsible for event push will occupy the memory:

[0100]

[0101] Assume that the initial memory is 161M, and the number of services: number of Pods = 1:4. The relevant configuration data that needs to be added to the memory of the control node (or control node) responsible for event push will occupy the memory:

[0102]

[0103] Assume that the initial memory is 150M, and the number of services: number of Pods = 1:10. The relevant configuration data that needs to be added to the memory of the control node (or control node) responsible for event push will occupy the memory:

[0104]

[0105] After fitting the above data points with a polynomial, we can draw the following conclusions: The number of services and Pods is basically positively correlated with the increase in memory in a linear growth relationship, such as Figure 2b As shown, the fitting curve expression is: y=0.027199999999999998*x+155.499999999999997.

[0106] (2) Relationship between the number of routes and memory

[0107] The number of services and Pods is fixed. Assume that in a scenario with 1,000 services and 1,000 Pods, the control node imports 1,000 services, then creates 40 domain names, and randomly creates routes under the 40 domain names. Assume that the initial memory is 149MB, the memory level is 228MB after adding the service source configuration data and importing the service configuration data on the control node, and the size of the Yaml file used to configure a single domain name is 554B (bytes). Among them, the increase in memory is related to the number of routes. The difference between the amount of memory after adding the route configuration data in the next line and the amount of memory after adding the route configuration data in the previous line is the increase in memory.

[0108]

[0109] After fitting the above data points with a polynomial, we can draw the following conclusion: the number of routes and the increase in memory are basically in a positively correlated linear growth relationship. Figure 2c As shown, the above fitting curve expression is: y=0.0104999999999999968*x+228.83333333333334.

[0110] (3) Relationship between the number of domain names and memory

[0111] The number of services and Pods is fixed. In the scenario of 1000 services and 1000 Pods, the control node imports 1000 services, then creates domain names, and does not create routes. Assuming the initial memory is 154MB, the size of the Yaml file used to configure a single domain name is 554B (bytes). Among them, the increase in memory is related to the number of domain names. The difference between the amount of memory after adding the domain name configuration data in the next line and the amount of memory after adding the domain name configuration data in the previous line is the increase in memory.

[0112]

[0113] After fitting the above data points with a polynomial, we can observe that the number of domain names and the increase in Istio memory are basically positively correlated and linearly increased. Figure 2d As shown, the above fitting curve expression is: y=0.0176333333333333306*x+154.433333333333334.

[0114] Based on the data in the tables shown in (1) to (3) above, we can analyze the data obtained, that is, the average value of the fields occupied by each service, Pod, route, and domain name. We substitute the above formula 2 into the following formula 3:

[0115]

[0116] According to the fitting relationship in the above formula 3, the average of the slopes of each verification is taken to obtain the formula 1 in the previous article:

[0117]

[0118] In this way, a linear regression can be performed on the average amount of memory consumed to push a single aggregate event and the application scale information, thereby obtaining a functional relationship between the average amount of memory consumed to push a single aggregate event and the application scale information of the target application, such as the above formula 1. It should be noted that the above formula 1 is only an exemplary description, and the functional relationship obtained by linear regression in different scenarios or under different conditions is different. The embodiment of the present application does not limit the specific implementation method of the functional relationship.

[0119] It should be noted that the embodiments of the present application do not limit the deployment and implementation methods of the event push method. It can be deployed on a single device or distributed, for example, by the cooperation of the control node in the service grid and the dynamically variable number of proxy nodes. The control node or proxy node is ultimately carried on the physical resource node. There is no limitation on the form of the physical resource node. It can be various terminal devices such as computers and mobile phones, or various server devices such as conventional servers, cloud servers, and server clusters.

[0120] The following is an exemplary description of the distributed deployment implementation method. In view of this, the present application embodiment also provides a service grid system 30. Figure 2e As shown, the service grid system 30 may include: a management and control node 301 and a dynamically variable number of proxy nodes 302, and the proxy nodes are deployed in the service nodes in the microservice system.

[0121] Among them, the control node 301 is used to push aggregation events to the proxy node, and the aggregation events are aggregated by the target events whose receiving time falls within the aggregation window; and in the process of pushing the aggregation events, respond to the occurrence of the memory protection trigger event, and obtain the actual usage information of the target memory resources. The target memory resources are the memory resources used by the control node to push the aggregation events; if it is determined that the memory protection needs to be triggered according to the actual usage information of the target memory resources, the aggregation window is increased, and the target events whose receiving time falls within the increased aggregation window are aggregated to obtain the aggregation events, and when the aggregation events are scheduled, the aggregation events are pushed to the currently existing target nodes based on the available memory resources in the target memory resources.

[0122] In this embodiment, during the aggregation event push process, in response to the occurrence of a memory protection trigger event, the actual usage information of the target memory resources can be obtained; if it is determined that memory protection needs to be triggered based on the actual usage information of the target memory resources, the aggregation window is increased; the target events whose receiving time falls within the increased aggregation window are aggregated to obtain an aggregation event; when the aggregation event is scheduled, the aggregation event is pushed to the currently existing target node based on the available memory resources in the target memory resources. In this way, the aggregation window can be reasonably increased based on the actual usage information of the target memory resources to increase the number of target events whose receiving time falls within the aggregation window, thereby reducing the number of aggregation events obtained by the aggregation process, thereby reducing the number of calculations of the context information involved, and reducing the consumption of memory resources.

[0123] Optionally, when the management and control node 301 responds to the occurrence of a memory protection trigger event and obtains actual usage information of the target memory resources, it is specifically used to: respond to the occurrence of a memory protection trigger event and predict the average amount of memory required to push a single aggregate event; if there are currently aggregate events to be pushed, determine the actual usage information of the target memory resources based on the number of aggregate events to be pushed and the average amount of memory.

[0124] Optionally, the target node is associated with a target application, and the target event is an event corresponding to the target application. When the management and control node 301 responds to the occurrence of a memory protection trigger event and predicts the average amount of memory required to push a single aggregate event, it is specifically used to: respond to the occurrence of a memory protection trigger event, and predict the average amount of memory required to push a single aggregate event based on the target application scale information corresponding to the target application at the target time, wherein the target application scale information at least includes the number of objects whose memory resources need to be consumed to push the aggregate event at the target time and the amount of memory consumed; or respond to the occurrence of a memory protection trigger event, and predict the average amount of memory required to push a single aggregate event based on the number of aggregate events pushed within a specified time period and the amount of memory consumed by pushing the pushed aggregate events.

[0125] Optionally, the management and control node 301 responds to the occurrence of a memory protection trigger event, and predicts the average amount of memory required to push a single aggregate event based on the target application scale information corresponding to the target application at the target time, including: obtaining a functional relationship between the average amount of memory required to push a single aggregate event and the application scale information of the target application, in which the application scale information is the independent variable and the average amount of memory is the dependent variable; substituting the target application scale information into the functional relationship to obtain the average amount of memory required to push a single aggregate event.

[0126] Optionally, when the management and control node 301 determines the actual usage information of the target memory resource based on the number of aggregate events to be pushed and the average memory amount, it is specifically used to: read the current usage of the target memory resource; calculate the potential amount of memory required to push the aggregate events to be pushed based on the number of aggregate events to be pushed and the average memory amount; determine the actual usage of the target memory resource when all existing aggregate events are pushed based on the current usage of the target memory resource and the potential memory amount, as the actual usage information.

[0127] Optionally, the management and control node 301 is also used to: count the aggregate events obtained by the aggregation processing to obtain a first count value, and count the pushed aggregate events to obtain a second count value; determine whether there are aggregate events to be pushed and the number of aggregate events to be pushed if there are any aggregate events based on the first count value and the second count value.

[0128] Optionally, the management and control node 301 is also used to: for any aggregation event, record the number of target nodes that exist when the aggregation event is obtained as a first number; and after pushing the collection event, count the number of target nodes that return a response message as a second number; if the second number is the same as the first number or the number of currently surviving connections, determine that the aggregation event is a pushed aggregation event.

[0129] Optionally, when the management and control node 301 determines whether it is necessary to trigger memory protection based on the actual usage information of the target memory resources, it is specifically used to: if it is determined based on the actual usage information of the target memory resources that the actual usage of the target memory resources is greater than or equal to the set memory protection threshold and is less than the set garbage collection threshold, determine that memory protection needs to be triggered; if the actual usage of the target memory resources is greater than or equal to the set garbage collection threshold, perform a garbage collection operation on the target memory resources.

[0130] Optionally, when the management and control node 301 increases the aggregation window, it is specifically used to: determine an adjustment coefficient based on actual usage information of the target memory resource, and the adjustment coefficient is greater than 1; adjust the size of the aggregation window according to the adjustment coefficient to increase the aggregation window.

[0131] Optionally, the target node is associated with a target application, and the target event is an event corresponding to the target application. Before obtaining the actual usage information of the target memory resources, the management and control node 301 is also used to: determine whether the most recent garbage collection operation occurred between the last memory protection triggering event and the current memory protection triggering event based on the execution time of the most recent garbage collection operation; determine whether the target application has been scaled down based on the application scale information of the target application at the time of the current memory protection triggering event and the time of the last memory protection triggering event; if the judgment result of any judgment operation is yes, wait for the next memory protection triggering event to occur; if the judgment results of all judgment operations are no, execute the operation of obtaining the actual usage information of the target memory resources.

[0132] Optionally, the memory protection triggering event includes: a memory protection period arrival event, and / or a push completion event corresponding to the last push aggregation event.

[0133] The detailed implementation and beneficial effects of each step in the method of this embodiment have been described in detail in the aforementioned embodiments and will not be elaborated here.

[0134] Following the above embodiments, the following will be combined Figure 3 The specific implementation of the event push method and the event push system in actual application scenarios is explained.

[0135] In actual application scenarios, the control node can be configured with the following three functional modules: an event counter, a memory predictor, and a window dynamic adjuster, and at least a push coroutine, a send coroutine, and a push connection coroutine. The push coroutine can be used to push aggregated events to a push queue, the send coroutine can be used to push aggregated events to a push channel, and the push connection coroutine can be used to take aggregated events out of the push channel and push them to the corresponding proxy node. On this basis, in response to the problem of pseudo-alive state that may appear in the memory in asynchronous task scenarios, the embodiment of the present application can achieve more accurate memory prediction and memory protection effects based on the control node to solve this problem. Among them, the memory appears in a pseudo-alive state, that is, when a new target event arrives and the new target event is aggregated, if the aggregated event obtained by the previous aggregation process has not yet completed the push, then the current memory usage is not a real state. In order to solve the above problems and achieve more accurate memory prediction and memory protection effects, the overall architecture flow chart of this solution is as follows. Figure 3 shown.

[0136] Figure 3The event counter in is mainly used to save the number of events that have been submitted and the number of events that have been completed; the memory predictor is mainly used to calculate the actual usage information of the target memory resources based on the event counter and in combination with the memory prediction algorithm; the window dynamic adjuster is mainly used to adjust the aggregation window according to the actual usage information calculated by the memory predictor to control the push speed. The following will explain the above functional modules of the control node in detail.

[0137] like Figure 4 As shown, two atomic variables can be maintained in the event counter to save the number of submitted events and the number of completed events. Before the aggregated event obtained by the aggregation process is pushed to the push queue, the counter used to save the number of submitted events + N, where N is the number of currently existing proxy nodes, is dynamically changing. The links corresponding to the proxy nodes can be maintained in the memory. Therefore, by traversing the number of data structures of the links existing in the memory, the number of currently existing proxy nodes can be obtained. After the aggregated event is successfully pushed to each proxy node, the callback function can add 1 to the counter of the number of completed events.

[0138] It should be noted that (1) the two atomic variables maintained in the event counter need to maintain atomicity, that is, they will not be interrupted by the operations of other threads. (2) Since the number of proxy nodes changes dynamically, the event counter needs the ability to clean up dirty data in order to cope with the situation where the links with some proxy nodes are suddenly disconnected. That is, for any aggregate event, the event counter is used to record the number of target nodes that exist when the aggregate event is obtained as the first number; and after pushing the aggregate event, the event counter is used to count the number of target nodes that return the response message as the second number; if the second number is the same as the first number or the number of currently alive connections, the aggregate event is determined to be a pushed aggregate event. (3) Since the management node and the proxy node are in a one-to-many relationship, and the submission of events is split from 1 to N, the event counter needs to dynamically maintain the proportional relationship between the number of event submissions and the number of event completions, that is, the number of completed events will be increased by 1 only when it is determined that the aggregate event will be pushed to N proxy nodes.

[0139] like Figure 5 As shown in the figure, after each aggregate event is pushed to the proxy node, the event count can be performed, that is, the counter of the number of completed events is increased by 1, and memory prediction and protection behavior are triggered. The memory predictor can predict the average amount of memory required to push a single aggregate event based on the number of aggregate events pushed in a specified period and the amount of memory consumed by pushing the pushed aggregate events. Figure 5 The designated time period is only used as an example to illustrate the most recent push corresponding time period, and the designated time period is not limited. Figure 5The "number of events pushed last time" in the above embodiment corresponds to the "number of aggregated events pushed within a specified period of time". Figure 5 The "most recent push memory level" corresponds to the "memory amount consumed by pushing the pushed aggregate events" in the aforementioned embodiment, which is the average amount of memory required to push a single aggregate event, that is, the average push memory consumption.

[0140] Since memory computing requires I / O (Input / Output), an asynchronous queue can be used in the callback function to prevent blocking the main thread. Specifically, the three queues are asynchronous, and the callback function is in the main thread. In order to prevent the impact on the main thread, an asynchronous queue can be added, and the callback function can be added to the newly added asynchronous queue as an event, and the callback function can be read from the asynchronous queue to reduce the impact on the main thread.

[0141] It should be noted that the following points are taken into consideration: (1) During the memory prediction process, the current memory needs to be read, which requires I / O operations, and high-frequency IO operations will cause performance problems; (2) The time point of pushing the average memory consumption has a great impact on the accuracy of the data; (3) Since memory calculation is triggered by events, if GC occurs between two events or the service scale is reduced, the memory change is a negative value and the negative change needs to be smoothed. Considering the above points, this case can determine whether the most recent garbage collection operation occurred between the last memory protection triggering event and the current memory protection triggering event based on the execution time of the most recent garbage collection operation; determine whether the target application has been reduced in scale based on the application scale information of the target application at the time of the current memory protection triggering event and the time of the last memory protection triggering event; if the judgment result of any judgment operation is yes, wait for the next memory protection triggering event to occur; if the judgment results of all judgment operations are no, execute the operation of obtaining the actual usage information of the target memory resource. In this way, it is possible to more accurately determine whether it is necessary to obtain the actual usage information and perform memory prediction, so as to reasonably select the timing of memory prediction, thereby more effectively avoiding the performance problems caused by high-frequency calculations.

[0142] The memory predictor can calculate the actual usage information of the target memory resources based on the event counter and the memory prediction algorithm. In this case, the temporary memory occupied during the context information calculation process is strongly correlated with the number of services, service size, number of nodes, size occupied by Pod, and routing, domain name and other factors of the backend application. And after the model regression process, the memory prediction algorithm can be derived.

[0143] like Figure 6As shown, the window dynamic adjuster can first calculate the current memory usage. If the number of submitted events is greater than the number of completed events, it means that there are still events that have not been processed, so the memory required to process the unprocessed events should be added. Figure 6 In , assuming that the number of submitted events is 6, the number of completed events is 4, the count value of the data plane counter is 2 (that is, the number of currently existing proxy nodes), and the number of uncompleted events = 6-4 = 2; in Figure 6 In the example, assuming that the current memory value is 2.8GB, the average memory consumption predicted by the memory predictor (i.e., the average memory consumption of pushing a single aggregate event in the above embodiment) is 150MB, then the actual memory information is 2.8+0.15×2=3.1GB; the memory occupancy rate is calculated based on the actual memory value, and the memory occupancy rate is compared with the set occupancy rate threshold; if the memory occupancy rate exceeds the occupancy rate threshold, a forced garbage collection operation is triggered. If the memory occupancy rate does not exceed the set occupancy rate threshold, but the actual memory value exceeds the memory protection threshold, memory protection can be triggered. Figure 6 In the figure, 3GB is taken as the memory protection threshold as an example. The real value of the memory exceeds the memory protection threshold, triggering memory protection; therefore, the window dynamic adjuster adjusts the size of the aggregation window. Optionally, a linear growth method can be used to calculate the upper limit value; that is, the more the actual usage of the target memory resource when all existing aggregation events are pushed, the larger the aggregation window. In addition to the above linear growth method, it can also be an exponential growth method, etc., which is not limited by the embodiment. After adjusting the aggregation window, the target events whose receiving time falls into the aggregation window can be aggregated into aggregation events based on the aggregation window. Further optionally, when adjusting the aggregation window, the time of the next garbage collection (GC) can be considered, and the difference between the next GC time and the current time can be used as the basis for adjusting the size of the aggregation window, so as to aggregate the target events before the arrival of the next GC into one aggregation event as much as possible to reduce memory consumption.

[0144] The following will be combined Figure 7-Figure 9 , an example is given to illustrate the overall push process in the actual application scenario. Figure 7-9 In , the push of aggregate events is called a task, and the number of submitted events, completed events, and uncompleted events are also called the number of submitted tasks, the number of completed tasks, and the number of uncompleted tasks.

[0145] like Figure 7As shown, events 5, 6, 7, and 8 are waiting in the waiting queue to be aggregated. At this time, events 3 and 4 will be aggregated into aggregate event M3, and M1 and M2 are aggregate events waiting to be pushed to the corresponding proxy nodes. At this time, the number of submitted tasks is 2, and the number of completed tasks (number of completed events) is 0. Because no tasks have been pushed, the average memory consumption is 0 at this time. The memory protection threshold is 80%, the upper limit of memory is 4 GiB (GibiByte), the current memory usage is 150 MB, the minimum aggregation window duration is limited to 2 minutes, and the current aggregation window size is 100 ms. Figure 7-Figure 9 In this example, GiB is simply represented as Gi.

[0146] After M1 and M2 are pushed to the proxy node, the event counter and memory predictor callback can be triggered. In addition, events 3 and 4 have been aggregated into M3 and pushed to the queue for scheduling. The number of submitted tasks (i.e., the number of submitted events) can be changed to 3, the number of completed tasks (i.e., the number of completed events) is 2, and the average push consumption is calculated to be 100MB. Assuming that the current memory usage has reached 3.15GiB, then after calculation by the memory protector, the window should be adjusted to 2.01min, such as Figure 8 The calculation process includes: according to the current memory usage of 3.1GiB and the number of unfinished tasks (3-2), and the average memory consumption of the last push of 100MB, the current actual memory usage is calculated as 3.15GiB+100MB=3.25GiB. If the ratio of the current actual memory usage to the memory upper limit of 4GiB is greater than the memory protection threshold of 80%, the memory protection is triggered and the aggregation window size is adjusted; Figure 8 As shown in the figure, the current actual memory usage and the memory protection threshold (that is, 4 GiB*80%) can be used as adjustment coefficients and multiplied by the minimum aggregation window duration. The multiplication result 2min*(3.25 / 3.2)=2.01min can be used as the new aggregation window size.

[0147] like Fig. 9 As shown in the figure, since the aggregation window is increased to 2.01 minutes, more events can be aggregated. Events 5, 6, 7, and 8 can be aggregated into one aggregation event instead of being aggregated into multiple aggregation events. This reduces the number of aggregation events and the number of pushes, thereby saving memory resources consumed by the push process and reducing the probability of OOM.

[0148] The above describes in detail the deployment method of the embodiment of the present application in the actual application scenario. In this way, the control plane can effectively ensure the memory growth in the frequent push scenario, and improve the memory utilization under the premise of ensuring the logical correctness of the data plane, and effectively avoid the OOM problem of the control plane instance.

[0149] In addition, the inventor of this case also conducted experiments in a gateway system based on grid services and determined the actual effect of the above scheme. The specific experimental scenario is: 25,000 gateway services, 50,000 Pods, 6,249 service access portals (Ingress), and the specification of the control node is 2C / 4G (2 processor cores and 4GB memory). Among them, Ingress is an API object that exposes the internal gateway service of the gateway system based on grid services through HTTP (Hypertext Transfer Protocol). Based on the memory protection scheme, by changing services and nodes in the above experimental scenario, the following conclusions can be drawn: the size of the aggregation window is adapted to the memory consumption. When the memory consumption is high, the aggregation window is larger. On the contrary, the aggregation window is smaller, and the memory peak value in the whole process is at about 75% of the water level. There is no restart event in the whole process (that is, no OOM occurs), and the overall process is relatively stable.

[0150] In the above embodiments, the focus is on describing the relevant content of increasing the aggregation window when triggering memory protection. In order to avoid unlimited increase of the aggregation window, a lower limit value (for example, 100ms) and an upper limit value (for example, 5min) can be set for the aggregation window. In addition, when it is determined that there is no need to trigger memory protection based on the actual usage information of the target memory resources, the aggregation window can be appropriately reduced, or the size of the aggregation window can be reset to the lower limit; or, when it is determined that there is no need to trigger memory protection for multiple consecutive times, the aggregation window can be appropriately reduced, or the size of the aggregation window can be reset to the lower limit; or, when it is determined that the actual usage of the target memory resource is lower than the set usage threshold based on the actual usage information of the target memory resource, the size of the aggregation window can be reset to the lower limit; etc.

[0151] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 21 to 24 can be device A; for another example, the execution subject of steps 21 and 22 can be device A, and the execution subject of steps 23-24 can be device B; and so on.

[0152] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and the sequence numbers of the operations, such as 21, 22, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0153] Fig.10 The schematic diagram of the structure of an event push method device provided by another exemplary embodiment of the present application. The event push method device is used to push aggregate events to a dynamically variable number of target nodes, wherein the aggregate events are aggregated by target events whose receiving time falls within the aggregation window. Fig.10 As shown, the device comprises:

[0154] The acquisition unit 1201 is used to respond to the occurrence of a memory protection trigger event and obtain actual usage information of the target memory resource during the aggregation event pushing process, where the target memory resource is the memory resource used for pushing the aggregation event; the increase unit 1202 is used to increase the aggregation window if it is determined that memory protection needs to be triggered based on the actual usage information of the target memory resource; the aggregation unit 1203 is used to aggregate the target events whose receiving time falls within the increased aggregation window to obtain the aggregation event; the push unit 1204 is used to push the aggregation event to the currently existing target node based on the available memory resources in the target memory resource when the aggregation event is scheduled.

[0155] Optionally, when the acquisition unit 1201 responds to the occurrence of a memory protection trigger event and obtains the actual usage information of the target memory resources, it is specifically used to: respond to the occurrence of a memory protection trigger event and predict the average amount of memory required to push a single aggregate event; if there are currently aggregate events to be pushed, determine the actual usage information of the target memory resources based on the number of aggregate events to be pushed and the average amount of memory.

[0156] Optionally, the target node is associated with a target application, and the target event is an event corresponding to the target application. When the acquisition unit 1201 responds to the occurrence of a memory protection trigger event and predicts the average amount of memory required to push a single aggregate event, it is specifically used to: respond to the occurrence of a memory protection trigger event, and predict the average amount of memory required to push a single aggregate event based on the target application scale information corresponding to the target application at the target moment, wherein the target application scale information at least includes the number of objects whose memory resources need to be consumed to push the aggregate event at the target moment and the amount of memory consumed; or respond to the occurrence of a memory protection trigger event, and predict the average amount of memory required to push a single aggregate event based on the number of aggregate events pushed within a specified time period and the amount of memory consumed by pushing the pushed aggregate events.

[0157] Optionally, the acquisition unit 1201 responds to the occurrence of a memory protection trigger event, and predicts the average amount of memory required to push a single aggregate event based on the target application scale information corresponding to the target application at the target time. It is specifically used to: obtain the functional relationship between the average amount of memory required to push a single aggregate event and the application scale information of the target application, in which the application scale information is the independent variable and the average amount of memory is the dependent variable; substitute the target application scale information into the functional relationship to obtain the average amount of memory required to push a single aggregate event.

[0158] Optionally, when the acquisition unit 1201 determines the actual usage information of the target memory resources based on the number of aggregate events to be pushed and the average memory amount, it is specifically used to: read the current usage of the target memory resources; calculate the potential amount of memory required to push the aggregate events to be pushed based on the number of aggregate events to be pushed and the average memory amount; determine the actual usage of the target memory resources when all existing aggregate events are pushed as the actual usage information based on the current usage of the target memory resources and the potential memory amount.

[0159] Optionally, the acquisition unit 1201 is also used to: count the aggregate events obtained by the aggregation processing to obtain a first count value, and count the pushed aggregate events to obtain a second count value; and determine whether there are aggregate events to be pushed and the number of aggregate events to be pushed if there are any aggregate events based on the first count value and the second count value.

[0160] Optionally, the acquisition unit 1201 is also used to: for any aggregation event, record the number of target nodes that exist when the aggregation event is obtained as the first number; and after pushing the collection event, count the number of target nodes that return received response messages as the second number; if the second number is the same as the first number or the number of currently surviving connections, determine that the aggregation event is a pushed aggregation event.

[0161] Optionally, the increase unit 1202 is also used for: if it is determined based on the actual usage information of the target memory resources that the actual usage of the target memory resources is greater than or equal to the set memory protection threshold and is less than the set garbage collection threshold, determining that memory protection needs to be triggered; if the actual usage of the target memory resources is greater than or equal to the set garbage collection threshold, performing a garbage collection operation on the target memory resources.

[0162] Optionally, when increasing the aggregation window, the increasing unit 1202 is specifically used to: determine an adjustment coefficient according to actual usage information of the target memory resource, and the adjustment coefficient is greater than 1; and adjust the size of the aggregation window according to the adjustment coefficient to increase the aggregation window.

[0163] Optionally, the target node is associated with a target application, and the target event is an event corresponding to the target application. Before obtaining the actual usage information of the target memory resources, the acquisition unit 1201 is also used to: determine whether the most recent garbage collection operation occurred between the last memory protection triggering event and the current memory protection triggering event based on the execution time of the most recent garbage collection operation; determine whether the target application has been scaled down based on the application scale information of the target application at the time of the current memory protection triggering event and the time of the last memory protection triggering event; if the judgment result of any judgment operation is yes, wait for the next memory protection triggering event to occur; if the judgment results of all judgment operations are no, execute the operation of obtaining the actual usage information of the target memory resources.

[0164] Optionally, the memory protection triggering event includes: a memory protection period arrival event, and / or a push completion event corresponding to the last push aggregation event.

[0165] In this embodiment, the event aggregation idea is firstly adopted, that is, the target events to be pushed are aggregated to obtain aggregate events, and the events are pushed with the aggregate events as the granularity; further, in the process of pushing the aggregate events, memory protection trigger events and memory protection mechanisms are added for the memory resources used to push the aggregate events. When the memory protection trigger event occurs, the memory protection mechanism is executed to protect the memory resources and minimize the probability of OOM, that is, the actual usage information of the memory resources is obtained, the aggregation window is increased according to the actual usage information of the memory resources, and the target events are aggregated using the increased aggregation window, and then the processed aggregate events are pushed. Among them, the aggregation window can be reasonably increased based on the actual usage information of the memory resources. Due to the increase of the aggregation window, the number of events whose receiving time falls into the aggregation window increases, and the number of aggregate events obtained by the aggregation processing will decrease, thereby reducing the number of context information calculations, thereby reducing the consumption of memory resources by the push events, reducing the probability of OOM, and improving system stability.

[0166] The above describes the internal functions and structure of the event push device, such as Fig.11 As shown, in practice, the event push device can be implemented as an electronic device, including: a memory 1301, a processor 1302 and a communication component 1303.

[0167] The memory 1301 is used to store computer programs and can be configured to store various other data to support operations on the computing platform. Examples of such data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc.

[0168] The memory 1301 may be implemented by any type of volatile or nonvolatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0169] Processor 1302 is coupled to memory 1301 and is used to execute a computer program in memory 1301, so as to: in the process of pushing aggregation events, respond to the occurrence of a memory protection triggering event, and obtain actual usage information of target memory resources, where the target memory resources are the memory resources used to push the aggregation events; if it is determined that memory protection needs to be triggered based on the actual usage information of the target memory resources, then the aggregation window is increased; target events whose receiving time falls within the increased aggregation window are aggregated to obtain aggregation events; and when the aggregation event is scheduled, the aggregation event is pushed to the currently existing target node based on the available memory resources in the target memory resources.

[0170] Optionally, when processor 1302 responds to the occurrence of a memory protection trigger event and obtains actual usage information of the target memory resources, it is specifically used to: respond to the occurrence of a memory protection trigger event and predict the average amount of memory required to push a single aggregate event; if there are currently aggregate events to be pushed, determine the actual usage information of the target memory resources based on the number of aggregate events to be pushed and the average amount of memory.

[0171] Optionally, the target node is associated with a target application, and the target event is an event corresponding to the target application. When the processor 1302 responds to the occurrence of a memory protection trigger event and predicts the average amount of memory required to push a single aggregate event, it is specifically used to: respond to the occurrence of a memory protection trigger event, and predict the average amount of memory required to push a single aggregate event based on the target application scale information corresponding to the target application at the target moment, wherein the target application scale information at least includes the number of objects whose memory resources need to be consumed to push the aggregate event at the target moment and the amount of memory consumed; or respond to the occurrence of a memory protection trigger event, and predict the average amount of memory required to push a single aggregate event based on the number of aggregate events pushed within a specified time period and the amount of memory consumed by pushing the pushed aggregate events.

[0172] Optionally, processor 1302 responds to the occurrence of a memory protection trigger event, and predicts the average amount of memory required to push a single aggregate event based on the target application scale information corresponding to the target application at the target time. It is specifically used to: obtain the functional relationship between the average amount of memory required to push a single aggregate event and the application scale information of the target application, in which the application scale information is the independent variable and the average amount of memory is the dependent variable; substitute the target application scale information into the functional relationship to obtain the average amount of memory required to push a single aggregate event.

[0173] Optionally, when the processor 1302 determines the actual usage information of the target memory resources based on the number of aggregate events to be pushed and the average memory amount, it is specifically used to: read the current usage of the target memory resources; calculate the potential amount of memory required to push the aggregate events to be pushed based on the number of aggregate events to be pushed and the average memory amount; determine the actual usage of the target memory resources when all existing aggregate events are pushed based on the current usage of the target memory resources and the potential memory amount, as the actual usage information.

[0174] Optionally, the processor 1302 is also used to: count the aggregate events obtained by the aggregation processing to obtain a first count value, and count the pushed aggregate events to obtain a second count value; and determine whether there are aggregate events to be pushed and the number of aggregate events to be pushed if there are any aggregate events based on the first count value and the second count value.

[0175] Optionally, processor 1302 is also used to: for any aggregation event, record the number of target nodes that exist when the aggregation event is obtained as a first number; and after pushing the collection event, count the number of target nodes that return received response messages as a second number; if the second number is the same as the first number or the number of currently surviving connections, determine that the aggregation event is a pushed aggregation event.

[0176] Optionally, the processor 1302 is also used to: if it is determined based on the actual usage information of the target memory resources that the actual usage of the target memory resources is greater than or equal to the set memory protection threshold and less than the set garbage collection threshold, determine that memory protection needs to be triggered; if the actual usage of the target memory resources is greater than or equal to the set garbage collection threshold, perform a garbage collection operation on the target memory resources.

[0177] Optionally, when the processor 1302 increases the aggregation window, it is specifically used to: determine an adjustment coefficient according to actual usage information of the target memory resource, and the adjustment coefficient is greater than 1; adjust the size of the aggregation window according to the adjustment coefficient to increase the aggregation window.

[0178] Optionally, the target node is associated with a target application, and the target event is an event corresponding to the target application. Before obtaining the actual usage information of the target memory resources, the processor 1302 is also used to: determine whether the most recent garbage collection operation occurred between the last memory protection triggering event and the current memory protection triggering event based on the execution time of the most recent garbage collection operation; determine whether the target application has been scaled down based on the application scale information of the target application at the time of the current memory protection triggering event and the time of the last memory protection triggering event; if the judgment result of any judgment operation is yes, wait for the next memory protection triggering event to occur; if the judgment results of all judgment operations are no, execute the operation of obtaining the actual usage information of the target memory resources.

[0179] Optionally, the memory protection triggering event includes: a memory protection period arrival event, and / or a push completion event corresponding to the last push aggregation event.

[0180] Further, if Fig.11 As shown, the electronic device also includes: a display 1304, a power component 1305, an audio component 1306 and other components. Fig.11 Only some components are shown schematically, which does not mean that the electronic device only includes Fig.11 In addition, Fig.11 The components in the dashed box are optional components, not mandatory components, and the specific components depend on the product form of the working node. The working node of this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, or an IOT device, or a server-side device such as a conventional server, a cloud server, or a server array. If the working node of this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, etc., it can include Fig.11 If the working node of this embodiment is implemented as a server device such as a conventional server, a cloud server or a server array, it may not include Fig.11 Components within the dashed box.

[0181] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement each step that can be executed by an electronic device in the above method embodiment.

[0182] Accordingly, an embodiment of the present application also provides a computer program product, including a computer program / instruction. When the computer program / instruction is executed by a processor, the processor is enabled to implement each step that can be executed by an electronic device in the above method embodiment.

[0183] In this embodiment, the event aggregation idea is firstly adopted, that is, the target events to be pushed are aggregated to obtain aggregate events, and the events are pushed with the aggregate events as the granularity; further, in the process of pushing the aggregate events, memory protection trigger events and memory protection mechanisms are added for the memory resources used to push the aggregate events. When the memory protection trigger event occurs, the memory protection mechanism is executed to protect the memory resources and minimize the probability of OOM, that is, the actual usage information of the memory resources is obtained, the aggregation window is increased according to the actual usage information of the memory resources, and the target events are aggregated using the increased aggregation window, and then the processed aggregate events are pushed. Among them, the aggregation window can be reasonably increased based on the actual usage information of the memory resources. Due to the increase of the aggregation window, the number of events whose receiving time falls into the aggregation window increases, and the number of aggregate events obtained by the aggregation processing will decrease, thereby reducing the number of context information calculations, thereby reducing the consumption of memory resources by the push events, reducing the probability of OOM, and improving system stability.

[0184] The above-mentioned memory can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0185] The above-mentioned communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.

[0186] The display includes a screen, and the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0187] The power supply assembly provides power to various components of the device where the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply assembly is located.

[0188] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (Microphone, MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal.

[0189] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program codes.

[0190] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate a device for implementing the functions specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0191] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0192] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0193] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interface, network interface and memory.

[0194] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0195] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0196] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0197] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. An event push method, characterized in that: The method is used to push aggregate events to a dynamically variable number of target nodes, wherein the aggregate events are aggregated by target events whose receiving time falls within an aggregation window, and the method comprises: In the process of pushing the aggregate event, in response to the occurrence of the memory protection trigger event, actual usage information of the target memory resource is obtained, where the target memory resource is the memory resource used for pushing the aggregate event; If it is determined that memory protection needs to be triggered according to the actual usage information of the target memory resource, increasing the aggregation window; Aggregate the target events whose receiving time falls within the enlarged aggregation window to obtain aggregated events; wherein, as the aggregation window is enlarged, the number of target events whose receiving time falls within the enlarged aggregation window increases, and the number of aggregated events obtained by the aggregation process decreases; In the case where the aggregate event is scheduled, the aggregate event is pushed to the currently existing target node based on the available memory resources in the target memory resources.

2. The method according to claim 1, characterized in that In response to the occurrence of a memory protection trigger event, obtain the actual usage information of the target memory resources, including: In response to the occurrence of a memory protection trigger event, predict the average amount of memory required to push a single aggregate event; If there are currently aggregation events to be pushed, actual usage information of the target memory resource is determined according to the number of aggregation events to be pushed and the average memory amount.

3. The method according to claim 2, characterized in that The target node is associated with a target application, the target event is an event corresponding to the target application, and in response to the occurrence of a memory protection trigger event, an average amount of memory consumed for pushing a single aggregate event is predicted, including: In response to the occurrence of a memory protection trigger event, predict the average amount of memory required to push a single aggregate event based on the target application scale information corresponding to the target application at the target time, wherein the target application scale information includes at least the number of objects that need to consume memory resources to push the aggregate event at the target time and the amount of memory consumed; Alternatively, in response to the occurrence of a memory protection triggering event, the average amount of memory required to push a single aggregate event is predicted based on the number of aggregate events pushed within a specified period and the amount of memory consumed by pushing the pushed aggregate events.

4. The method according to claim 3, characterized in that In response to the occurrence of a memory protection trigger event, based on the target application scale information corresponding to the target application at the target time, an average amount of memory required to push a single aggregate event is predicted, including: Obtaining a functional relationship between an average amount of memory consumed for pushing a single aggregate event and application scale information of the target application, wherein the application scale information is an independent variable and the average amount of memory is a dependent variable; The target application scale information is substituted into the functional relationship to obtain the average amount of memory consumed to push a single aggregate event.

5. The method according to claim 2, characterized in that: Determining actual usage information of the target memory resource according to the number of aggregate events to be pushed and the average memory amount includes: Read the current usage of the target memory resource; Calculating the potential amount of memory required to push the aggregate events to be pushed according to the number of aggregate events to be pushed and the average amount of memory; According to the current usage of the target memory resource and the potential memory amount, the actual usage of the target memory resource when all existing aggregation events are pushed and completed is determined as the actual usage information.

6. The method according to claim 2, characterized in that Also includes: Counting the aggregated events obtained by the aggregation processing to obtain a first count value, and counting the pushed aggregated events to obtain a second count value; It is determined, according to the first count value and the second count value, whether there are aggregate events to be pushed and, if there are, the number of aggregate events to be pushed.

7. The method according to claim 6, characterized in that Also includes: For any aggregation event, the number of target nodes existing when the aggregation event is obtained is recorded as the first number; as well as After pushing the aggregation event, counting the number of target nodes that return receiving response messages as a second number; If the second number is the same as the first number or the number of currently alive connections, it is determined that the aggregate event is a pushed aggregate event.

8. The method according to any one of claims 1 to 7, characterized in that: Also includes: If it is determined according to the actual usage information of the target memory resource that the actual usage of the target memory resource is greater than or equal to the set memory protection threshold and less than the set garbage collection threshold, it is determined that memory protection needs to be triggered; If the actual usage of the target memory resource is greater than or equal to the set garbage collection threshold, a garbage collection operation is performed on the target memory resource.

9. The method according to any one of claims 1 to 7, characterized in that: Increase the aggregation window, including: Determine an adjustment coefficient according to actual usage information of the target memory resource, wherein the adjustment coefficient is greater than 1; The size of the aggregation window is adjusted according to the adjustment coefficient to increase the aggregation window.

10. The method according to any one of claims 1 to 7, characterized in that: The target node is associated with a target application, and the target event is an event corresponding to the target application. Before obtaining the actual usage information of the target memory resource, the method further includes: According to the execution time of the most recent garbage collection operation, determine whether the most recent garbage collection operation occurs between the last memory protection triggering event and the current memory protection triggering event; Determine whether the target application has been scaled down based on the application scale information of the target application when the current memory protection triggering event occurs and when the last memory protection triggering event occurs; If the result of any judgment operation is yes, then wait for the next memory protection trigger event to occur; if the results of all judgment operations are no, then execute the operation of obtaining the actual usage information of the target memory resource; Among them, the application scale information of the target application when this memory protection trigger event occurs includes at least: the number of objects that need to consume memory resources and the amount of memory consumed when pushing aggregation events when this memory protection trigger event occurs; the application scale information of the target application when the last memory protection trigger event occurs includes at least: the number of objects that need to consume memory resources and the amount of memory consumed when pushing aggregation events when the last memory protection trigger event occurs.

11. The method according to any one of claims 1 to 7, characterized in that: The memory protection triggering event includes: a memory protection period arrival event, and / or a push completion event corresponding to the last push aggregation event.

12. A service grid system, characterized in that: include: A control node and a dynamically variable number of proxy nodes, wherein the proxy nodes are deployed in the service nodes in the microservice system; The control node is used to push aggregate events to the proxy node, where the aggregate events are aggregated by target events whose receiving time falls within the aggregation window; And in the process of pushing aggregate events, in response to the occurrence of a memory protection trigger event, actual usage information of the target memory resource is obtained, and the target memory resource is the memory resource used by the control node to push the aggregate event; if it is determined that memory protection needs to be triggered based on the actual usage information of the target memory resource, the aggregation window is increased, and the target events whose receiving time falls within the increased aggregation window are aggregated to obtain the aggregate event, and when the aggregate event is scheduled, the aggregate event is pushed to the currently existing proxy node based on the available memory resources in the target memory resource; wherein, as the aggregation window is increased, the number of target events whose receiving time falls within the increased aggregation window increases, and the number of aggregate events obtained by the aggregation processing decreases.

13. An electronic device, characterized in that: include: Memory and processor; The memory is used to store a computer program, and the processor is coupled to the memory and is used to execute the computer program to implement the steps in the method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: The method comprises a computer program / instruction, which, when executed by a processor, enables the processor to implement the steps of the method according to any one of claims 1 to 11.

15. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, enables the processor to implement the steps of the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Method and device for automatically adjusting data processing time window

    CN111324392A

  • Data acquisition method and device, electronic equipment and storage medium

    CN117215758A