Resource processing method, apparatus, device, and storage medium
Patent Information
- Application Number
- CN202110949751.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-18
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2041-08-18
AI Technical Summary
[0018]本申请通过对数据节点处的资源对象异常事件进行监听,当监听到资源对象异常事件时,基于异常资源对象的对象标识以及相应的内存对象信息,确定异常资源对象所在的目标节点资源;基于目标节点资源对异常对象执行对应的资源处理操作。本申请通过异常资源对象的内存对象信息,能够便捷地确定所要处理的异常对象信息所在的目标节点资源,从而基于目标节点资源对异常资源对象以及异常资源对象对应的内存资源进行处理,提高了目标节点资源的查找效率以及对节点资源的处理效率;另外,本申请能够在数据处理过程中对资源对象异常事件进行实时监听,并基于对象异常类型及时对异常资源对象进行资源处理操作,从而使得异常资源对象所占用的资源能够被及时释放,避免了异常资源对象占用节点资源导致的资源浪费和资源流转率低的情况;异常资源对象所占用的资源节点被及时回收,避免了内存脏数据造成的内存泄漏,提升了资源对象管理系统的稳定性,以及提升了节点资源的装箱率。
Smart Images

Figure CN113656209B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a resource processing method, apparatus, device and storage medium. Background Technology
[0002] In data processing scenarios, data processing operations can be performed separately by creating multiple resource objects. Specifically, taking containers as an example, containerized delivery can improve the delivery efficiency of data processing. However, in containerized mode, memory leaks are inevitably introduced when the corresponding resources are not reclaimed in time after the container fails.
[0003] In existing technologies, abnormal containers are not reclaimed during data processing. Instead, they are only reclaimed after the data processing is completed and the resources are taken off the shelf. This results in abnormal containers continuously occupying resources without being released, which reduces the stability of the resource management system and the efficiency of resource flow. Summary of the Invention
[0004] The technical problem to be solved by this application is to provide a resource processing method, apparatus, device and storage medium that can improve the stability of the resource management system and the efficiency of resource circulation.
[0005] To address the aforementioned technical problems, a resource processing method is provided, comprising:
[0006] Listen for abnormal events of resource objects at data nodes; wherein the data node includes multiple resource objects;
[0007] When a resource object exception event is detected, determine the object identifier of the exception resource object carried by the exception event, as well as the object exception type;
[0008] Based on the object identifier of the abnormal resource object and the memory object information corresponding to the abnormal resource object, the target node resource where the abnormal resource object is located is determined; the memory object information corresponding to the abnormal resource object is used to point to the target node associated with the abnormal resource object.
[0009] Based on the target node resources, perform resource processing operations corresponding to the exception type of the object on the abnormal resource object.
[0010] On the other hand, a resource processing apparatus is provided, comprising:
[0011] The exception event listening module is used to listen for exception events of resource objects at data nodes; wherein the data node includes multiple resource objects.
[0012] The exception information determination module is used to determine the object identifier of the abnormal resource object carried by the abnormal resource object event and the object exception type when an abnormal event of a resource object is detected.
[0013] The target node resource determination module is used to determine the target node resource where the abnormal resource object is located based on the object identifier of the abnormal resource object and the memory object information corresponding to the abnormal resource object; the memory object information corresponding to the abnormal resource object is used to point to the target node associated with the abnormal resource object;
[0014] The resource processing module is used to perform resource processing operations corresponding to the exception type of the abnormal resource object based on the target node resources.
[0015] On the other hand, this application provides an apparatus comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the resource processing method as described above.
[0016] On the other hand, this application provides a computer storage medium storing at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded by a processor and executed as described above in the resource processing method.
[0017] Implementing the embodiments of this application has the following beneficial effects:
[0018] This application monitors resource object anomalies at data nodes. When an anomaly is detected, it determines the target node resource containing the anomaly based on the object identifier and corresponding memory object information. Then, it performs corresponding resource processing operations on the anomaly based on the target node resource. This application can easily determine the target node resource containing the anomaly to be processed by using the memory object information of the anomaly, thereby improving the efficiency of target node resource lookup and processing. Furthermore, this application can monitor resource object anomalies in real time during data processing and perform timely resource processing operations based on the anomaly type. This ensures that resources occupied by anomaly are released promptly, avoiding resource waste and low resource turnover caused by anomaly occupying node resources. The timely reclamation of resource nodes occupied by anomaly prevents memory leaks caused by dirty data, improves the stability of the resource object management system, and increases the binning rate of node resources. Attached Figure Description
[0019] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the implementation environment provided in the embodiments of this application;
[0021] Figure 2 This is a flowchart of a resource processing method provided in an embodiment of this application;
[0022] Figure 3 This is a flowchart of a resource object creation method provided in an embodiment of this application;
[0023] Figure 4 This is a flowchart of a resource object destruction method provided in an embodiment of this application;
[0024] Figure 5 This is a flowchart of another resource object creation method provided in an embodiment of this application;
[0025] Figure 6 This is a diagram illustrating an abnormal container cleanup and fault node recovery architecture provided in an embodiment of this application.
[0026] Figure 7 This is a schematic diagram of a resource processing device provided in an embodiment of this application;
[0027] Figure 8 This is a schematic diagram of a device structure provided in an embodiment of this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0030] Please see Figure 1 The illustration shows an implementation environment provided by the embodiments of this application. This application can be specifically applied to a distributed cluster, which may include: a resource management node 110 and a data node 120. The data node 120 includes multiple resource objects, and the management node 110 and the data node 120 can communicate with each other via a network.
[0031] Specifically, the resource management node 110 may include a management module and an exception handling module. The management unit can be used to perform operations such as creating and destroying resource objects on the data node 120, as well as maintaining the status information of resource objects. For example, when a resource object needs to be created, the management module first determines which node to create the resource object on, and then binds the resource object to be created to that node. When the status of a resource object contained in the data node 120 is abnormal, the corresponding resource object exception event is triggered. When the exception handling module listens for a resource object exception event, it processes the corresponding abnormal resource object.
[0032] Specifically, the management node 110 and the data node 120 can be servers. Servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0033] This application can also be applied to the blockchain field, which is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.
[0034] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operational monitoring. The user management module is responsible for managing the identity information of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the correspondence between user real identities and blockchain addresses (access management). Furthermore, under authorization, it monitors and audits transactions of certain real identities and provides risk control rule configuration (risk control audit). The basic services module is deployed on all blockchain node devices to verify the validity of business requests. After consensus is reached on valid requests, they are recorded in storage. For a new business request, the basic services first perform interface adaptation parsing and authentication (interface adaptation), and then encrypt the business information through a consensus algorithm (consensus management). After encryption, the data is transmitted completely and consistently to the shared ledger (network communication) and recorded and stored. The smart contract module is responsible for contract registration, issuance, triggering, and execution. Developers can define contract logic using a programming language and publish it to the blockchain (contract registration). According to the contract terms, the key or other events are invoked to trigger execution and complete the contract logic. It also provides functions for contract upgrades and cancellations. The operation monitoring module is mainly responsible for deployment, configuration modification, contract settings, cloud adaptation, and real-time status visualization output during product release, such as alarms, monitoring network conditions, and monitoring the health status of node devices.
[0035] The platform's product service layer provides the basic capabilities and implementation frameworks for typical applications. Developers can leverage these basic capabilities, along with the specific characteristics of their business needs, to implement blockchain-based business logic. The application service layer provides blockchain-based application services to business stakeholders.
[0036] To address the problem in existing technologies where abnormal containers continuously occupy resources without releasing them, thereby reducing the stability of resource management systems and the efficiency of resource flow, this disclosure provides a resource processing method, the execution entity of which can be... Figure 1 For the resource management node, please refer to [link / reference]. Figure 2 The method may include:
[0037] S210. Listen for abnormal events of resource objects at data nodes; wherein the data node includes multiple resource objects.
[0038] The distributed cluster in this embodiment may include multiple data nodes, and each data node may include at least one resource object, which may be created by a resource management node; please refer to Figure 3 It illustrates a method for creating resource objects, which may include:
[0039] S310. In response to a resource object creation instruction, determine the associated node corresponding to the target resource object to be created.
[0040] The resource object creation instruction can be sent from an external source to the distributed cluster in this embodiment. When the resource management node in the distributed cluster receives the resource object creation instruction, it can determine the associated node where the target resource object to be created is located based on the resource status of each data node, and assign the resource object creation task to the associated node, that is, create the target resource object on the associated node.
[0041] For example, the resource object creation instruction may include object creation condition information, specifically the resource quantity information required by the target resource object to be created. Thus, the resource management node can filter the current data nodes and determine the data nodes whose available resource quantity meets the resource quantity required by the target resource object as the associated nodes corresponding to the target resource object.
[0042] S320. Bind the target resource object to the associated node.
[0043] S330. Based on the target resource object and the associated node, generate the memory object information corresponding to the target resource object.
[0044] The memory object information of the target resource object can be used to point to the target node associated with the target resource object. Specifically, the memory object information of each resource object can be maintained in a list. The memory object information corresponding to each resource object can be identified by the object identifier of the resource object, so as to facilitate the differentiation and identification of the memory object information corresponding to different resource objects. In addition, when the target resource object is bound to the associated node, although the target resource object has not yet been created, the memory object information corresponding to the target resource object can be generated. The memory object information can contain the identifier information of the associated node where the target object is located.
[0045] S340. Create the target resource object on the associated node.
[0046] After the associated nodes are determined, the resource management node can send a resource object creation instruction to the associated nodes. Each data node can contain an object management module, which can determine the memory resource information occupied by the target resource object to be created according to the resource object creation instruction, and create the target resource object in the corresponding memory resource of the node. Specifically, the memory resource information can include the start and end address information of the memory resource occupied by the target resource object.
[0047] Based on the object creation condition information contained in the resource creation instruction, the resource management node assigns the resource object creation task to the corresponding associated node, thereby improving the accuracy and efficiency of resource object creation.
[0048] When the target resource object is successfully created, the memory resource information occupied by the target resource object in the associated node, as well as the running status of the target resource object, are added to the memory object information corresponding to the target resource object. That is, for a created target resource object, its corresponding memory object information is maintained. This memory object information may include descriptive information about the resource object, such as its running status and the resource information of the node where it resides. The resource information of the node where the resource object resides includes the node information, the starting address of the memory occupied by the resource object, and the size of the memory space occupied by the resource object. Therefore, the real-time running status of each resource object and the resource information of its node can be easily obtained through the memory object information, facilitating the maintenance and processing of each resource object and improving the efficiency of node resource processing.
[0049] S220. When a resource object exception event is detected, determine the object identifier of the exception resource object carried by the resource object exception event, as well as the object exception type.
[0050] Specifically, resource object exception events can be subscribed to via a subscription mechanism. In this embodiment, resource object exception events can be obtained by the object management module in each data node monitoring the resource objects in their respective nodes. When an abnormal state of a resource object is detected, a corresponding resource object exception event will be triggered. Each resource object exception event carries the object identifier of the abnormal resource object whose state is abnormal, as well as the object exception type.
[0051] S230. Based on the object identifier of the abnormal resource object and the memory object information corresponding to the abnormal resource object, determine the target node resource where the abnormal resource object is located; the memory object information corresponding to the abnormal resource object is used to point to the target node associated with the abnormal resource object.
[0052] The resource management node can maintain a list of memory object information. This list allows for the identification of the corresponding target node resource based on the object's identifier; as shown in Table 1.
[0053] Table 1
[0054]
[0055]
[0056] Table 1 shows the description information for each resource object. For example, resource object 1 has a creation error status and is bound to node A. However, due to the creation error, resource object 1 has not yet been created on node A, so there is no description of the corresponding memory starting address and the memory space it occupies. For resource object 2, its status is abnormal and not reclaimed. Its node is node B, and the starting address of the memory it occupies is Add2. Therefore, resource object 2 can be processed in the memory space starting from Add2 in node B.
[0057] The target node can be one of multiple data nodes. For an explanation of the memory object information corresponding to the abnormal resource object, please refer to the above content of this embodiment, which will not be repeated here.
[0058] S240. Based on the target node resources, perform resource processing operations on the abnormal resource object corresponding to the abnormal type of the object.
[0059] In this embodiment, the object exception types may include resource object creation exception, resource object exception not being recycled, and resource object recycling exception.
[0060] When the object exception type is resource object creation exception, it corresponds to step S340 above. The object management module in the target node performed the resource object creation operation, but the creation failed. The reason for the failure may be that the resource object failed to start. Since the resource object has not been successfully created at this time, it has not occupied the corresponding node resources, but has only been bound to the target node. At this time, the unbinding operation with the target node can be performed.
[0061] When the object exception type is "Resource Object Exception - Not Reclaimed," the target node resource is the target memory resource occupied by the exception resource object on the target node. Here, the target memory resource occupied by the exception resource object on the target node refers to the real-time memory resource information occupied on the target node, which may be the same as or different from the memory resource information occupied by the resource object determined when it was created. When destroying the exception resource object, a first destruction operation is performed on the exception resource object in the target memory resource. The first destruction operation is used to destroy the exception resource object when the process within it has finished executing. The first destruction operation reserves time for the running process within the exception resource object, such as waiting for I / O to complete, i.e., waiting for the process to finish executing before performing the exception resource destruction operation. For example, the first destruction operation can be a SIGTERM instruction, thereby avoiding the loss of data processing results caused by directly terminating the process during execution and improving the accuracy of data processing.
[0062] When a destruction operation has been performed on an abnormal resource object but failed, a resource object reclamation exception event is triggered. The corresponding object exception type is "Resource Object Reclamation Exception," and the corresponding target node resource is the target memory resource occupied by the abnormal resource object on the target node. The resource object reclamation exception includes failure to destroy the abnormal resource object based on the first destruction operation. Similarly, the target memory resource occupied by the abnormal resource object on the target node is the real-time memory resource information occupied on the target node, which may be the same as or different from the memory resource information occupied by the resource object determined when it was created.
[0063] Please see Figure 4 It illustrates a method for destroying resource objects, which may include:
[0064] S410. Perform a second destruction operation on the abnormal resource object; the second destruction operation is used to perform a destruction operation on the abnormal resource object when terminating a process in a normal state within the abnormal resource object.
[0065] S420. When the destruction of the abnormal resource object based on the second destruction operation fails, the target node is reset.
[0066] The second destruction operation does not wait for any running processes within the abnormal resource object and directly terminates the currently running processes. However, due to the presence of some processes, the second destruction operation cannot completely clean up the abnormal resource object. That is, if the second destruction operation fails to destroy the abnormal resource object, the method of resetting the target node can be used to achieve the destruction and reclamation of the abnormal resource object. The second destruction operation may include: deleting the memory object information corresponding to the abnormal resource object and executing the SIGKILL instruction; deleting the memory object information corresponding to the abnormal resource object can remove dirty data in the abnormal resource object. The method of resetting the target node includes recording the abnormal resource object and the target node where the abnormal resource object is located in the pipeline, waiting for the node to restart or reinstall, and completing the fallback reclamation of the abnormal resource object.
[0067] Please see Figure 5 It illustrates another method for creating resource objects, which may include:
[0068] S510. When an abnormal event of a resource object is detected, the target node associated with the abnormal resource object is marked as abnormal.
[0069] S520. When a resource object creation instruction is received, a resource object is created in the data nodes other than the target node that is marked as abnormal.
[0070] Target nodes marked as abnormal will not participate in the current task of creating resource objects. Since creating resource objects on nodes with abnormal resource objects may cause problems such as failure to create resource objects, instability of resource objects, or abnormal operation of resource objects, in order to avoid such problems, resource objects are created on nodes that are not marked as abnormal, which can improve the efficiency and stability of resource object creation.
[0071] This application monitors resource object anomalies at data nodes. When an anomaly is detected, it determines the target node resource containing the anomaly based on the object identifier and corresponding memory object information. Then, it performs corresponding resource processing operations on the anomaly based on the target node resource. This application can easily determine the target node resource containing the anomaly to be processed by using the memory object information of the anomaly, thereby improving the efficiency of target node resource lookup and processing. Furthermore, this application can monitor resource object anomalies in real time during data processing and perform timely resource processing operations based on the anomaly type. This ensures that resources occupied by anomaly are released promptly, avoiding resource waste and low resource turnover caused by anomaly occupying node resources. The timely reclamation of resource nodes occupied by anomaly prevents memory leaks caused by dirty data, improves the stability of the resource object management system, and increases the binning rate of node resources.
[0072] The specific implementation process of this application will be explained using the example of a resource object being a container. Please refer to [link / reference]. Figure 6 The diagram illustrates an architecture for abnormal container cleanup and fault node recovery. The container management system in the diagram corresponds to the management module mentioned above, and the abnormal container processing center corresponds to the abnormal processing module mentioned above. The architecture includes two layers and two processes. The two layers include the container management system and the abnormal container processing center. The two processes include the watch abnormal event and the automatic abnormal processing process.
[0073] The container management system performs operations such as container creation, destruction, and maintenance of the runtime state of containers. When the task platform sends a request to create a container to the container management system, the system will target a specific node and perform container binding and creation operations. Binding here means that the container is bound to a specific node, and the container resources are created on that node. The state of the created container is maintained in the container management system as a memory resource object. If the state of the container changes, an exception event will be triggered, and the state of the memory resource will also be changed.
[0074] Exception Container Processing Center: By classifying the state of exception containers, exception containers are divided into three categories, and corresponding automated processing procedures are executed for each type of exception event.
[0075] Watch for abnormal events: The memory resource objects in the container management system maintain state information during the container's lifecycle. If a container experiences an abnormal state and an event is triggered, the state information of the corresponding memory resource object will be updated. The abnormal container handling center has a watch controller. By implementing the watch controller, you can subscribe to event events that change the container's state information. When a triggered event is emitted, the watch controller will capture the event. If it is determined to be an abnormal event, it will execute the cleanup and repair process for the abnormal container.
[0076] Automatic exception handling process: After the watch controller detects an exception event in a container, it sends the exception container to the exception handling center for recycling and cleanup. This exception cleanup operation has three steps. The first step is if the container has not yet been created and only the binding operation has been completed, then the node information is cleaned up and unbound. The second step is if the container is exception-prone but cleanup has not been performed, then the container's SIGTERM recycling is performed first. If recycling is successful, the cleanup process ends. If recycling fails, the third step is performed. The third step is if the container has already undergone recycling and cleanup but has not been cleaned up completely, then a forced recycling operation can be performed. This forced recycling operation includes two aspects: first, cleaning up the container management system's memory object information; second, performing the SIGKILL process. If recycling and cleanup are still not achieved, it is recorded in the log, and the node is restarted or reinstalled.
[0077] The node where the abnormal container is successfully cleaned up will be added back to the container management system. This is because when a container abnormality occurs, the device node will be marked as dirty, meaning that no new containers will be scheduled to that node. After the abnormal container is successfully cleaned up, the dirty mark will be cleared, and new containers will be scheduled to that node again.
[0078] In data processing scenarios, such as AI training scenarios, this application performs a watch operation on the container state events of delivered containers. When an abnormal event is watched, a corresponding automated processing strategy is triggered for each abnormal event, realizing the recycling of abnormal containers and the recovery of faulty nodes in the AI training process. It has the following beneficial effects:
[0079] 1) Container-occupied resources are released promptly, preventing resource waste and low resource turnover caused by the accumulation of abnormal containers occupying node resources. 2) Memory resources occupied by abnormal containers are reclaimed promptly, preventing memory leaks caused by dirty memory data and ensuring the stability of the container management system. 3) The operational efficiency of the container system is improved. Abnormal containers are handled promptly, preventing the accumulation of abnormal containers from causing complex maintenance work and reducing the need for maintenance personnel. 4) The container packing rate of resource nodes is improved, and resource costs are reduced. After a resource node is allocated containers, if the containers fully utilize the node's resources, it can be considered a 100% packing rate. If a container malfunctions and occupies A% of the node's resources, and the container is not reclaimed, the node's packing rate drops to 100% - A%.
[0080] Please see Figure 7 This embodiment also provides a resource processing device, which may include:
[0081] The exception event listening module 710 is used to listen for exception events of resource objects at the data node; wherein the data node includes multiple resource objects.
[0082] The exception information determination module 720 is used to determine the object identifier of the abnormal resource object carried by the abnormal resource object event and the object exception type when an abnormal resource object event is detected.
[0083] The target node resource determination module 730 is used to determine the target node resource where the abnormal resource object is located based on the object identifier of the abnormal resource object and the memory object information corresponding to the abnormal resource object; the memory object information corresponding to the abnormal resource object is used to point to the target node associated with the abnormal resource object.
[0084] The resource processing module 740 is used to perform resource processing operations corresponding to the exception type of the abnormal resource object based on the target node resources.
[0085] Furthermore, the device also includes:
[0086] The instruction response module is used to respond to resource object creation instructions and determine the associated node corresponding to the target resource object to be created;
[0087] A binding module is used to bind the target resource object to the associated node;
[0088] The memory object information generation module is used to generate memory object information corresponding to the target resource object based on the target resource object and the associated node;
[0089] The first creation module is used to create the target resource object on the associated node.
[0090] Furthermore, the device also includes:
[0091] The information adding module is used to add the memory resource information occupied by the target resource object in the associated node and the running status of the target resource object to the memory object information corresponding to the target resource object when the target resource object is successfully created.
[0092] Furthermore, when the object exception type is a resource object creation exception, the target node resource is the target node bound to the exception resource object;
[0093] The resource processing module 740 includes:
[0094] The unbinding module is used to perform an unbinding operation between the abnormal resource object and the target node.
[0095] Furthermore, when the object exception type is a resource object exception that has not been reclaimed, the target node resource is the target memory resource occupied by the exception resource object on the target node;
[0096] The resource processing module 740 includes:
[0097] The first processing module is used to perform a first destruction operation on the abnormal resource object in the target memory resource;
[0098] The first destruction operation is used to destroy the abnormal resource object when the process in the abnormal resource object has finished executing.
[0099] Furthermore, when the object exception type is a resource object reclamation exception, the target node resource is the target memory resource occupied by the exception resource object on the target node; the resource object reclamation exception includes failure to destroy the exception resource object based on the first destruction operation;
[0100] The resource processing module 740 includes:
[0101] The second processing module is used to perform a second destruction operation on the abnormal resource object; the second destruction operation is used to perform a destruction operation on the abnormal resource object when terminating a process in the normal state within the abnormal resource object; when the destruction of the abnormal resource object based on the second destruction operation fails, the target node is reset.
[0102] Furthermore, the device also includes:
[0103] The exception marking module is used to mark the target node associated with the exception resource object as an exception when an exception event of a resource object is detected.
[0104] The second creation module is used to create resource objects in data nodes other than the target node that is marked as abnormal when a resource object creation instruction is received.
[0105] The apparatus provided in the above embodiments can execute the methods provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the above embodiments can be found in the methods provided in any embodiment of this application.
[0106] This embodiment also provides a computer-readable storage medium storing at least one instruction or at least one program, which is loaded by a processor and executed as any of the methods described above in this embodiment.
[0107] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the methods described in this embodiment.
[0108] Furthermore, Figure 8 A schematic diagram of a hardware structure for implementing the method provided in the embodiments of this application is shown. This device may constitute or include the apparatus provided in the embodiments of this application. Figure 8 As shown, device 10 may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 8 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, device 10 may also include a... Figure 8 The more or fewer components shown, or having the same Figure 8 The different configurations shown.
[0109] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the device 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0110] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method described in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the aforementioned player preloading method or player running method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the device 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0111] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of device 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0112] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of device 10 (or a mobile device).
[0113] Any of the methods described above in this embodiment can be based on Figure 8 The equipment shown is used for implementation.
[0114] This specification provides the operational steps of the methods described in the embodiments or flowcharts, but more or fewer operational steps may be included based on conventional or non-inventive labor. The steps and order listed in the embodiments are merely one possible execution order among many steps and do not represent the only execution order. In actual system or interrupt product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0115] The structure shown in this embodiment is only a partial structure related to the solution of this application and does not constitute a limitation on the device to which the solution of this application is applied. Specific devices may include more or fewer components than shown, or combinations of certain components, or arrangements of different components. It should be understood that the methods, apparatuses, etc., disclosed in this embodiment can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or unit modules through some interfaces.
[0116] Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0117] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0118] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A resource processing method, characterized in that, include: Listen for abnormal events of resource objects at data nodes; The data node includes multiple resource objects; the resource objects are containers. When a resource object exception event is detected, determine the object identifier of the exception resource object carried by the exception event, as well as the object exception type; Based on the object identifier of the abnormal resource object and the memory object information corresponding to the abnormal resource object, the target node resource where the abnormal resource object is located is determined; the memory object information corresponding to the abnormal resource object is used to point to the target node associated with the abnormal resource object. Based on the target node resources, perform resource processing operations corresponding to the exception type of the abnormal resource object. The step of performing resource processing operations corresponding to the exception type of the abnormal resource object based on the target node resources includes: When the object exception type is a resource object creation exception, the target node resource is the target node bound to the exception resource object; Perform an unbinding operation between the abnormal resource object and the target node; When the object exception type is a resource object exception that has not been reclaimed, the target node resource is the target memory resource occupied by the exception resource object on the target node; a first destruction operation is performed on the exception resource object in the target memory resource; the first destruction operation is used to perform the destruction operation on the exception resource object when the process in the exception resource object has finished executing; When the object exception type is a resource object recycling exception, the resource object recycling exception includes failure to destroy the exception resource object based on the first destruction operation; execution of a second destruction operation on the exception resource object; the second destruction operation is used to perform the destruction operation on the exception resource object when terminating a process in the normal state of the exception resource object; when the destruction of the exception resource object based on the second destruction operation fails, the target node is reset; the method of resetting the target node includes recording the exception resource object and the target node where the exception resource object is located in the pipeline, waiting for the node to restart or reinstall, and completing the fallback recycling of the exception resource object.
2. The resource processing method according to claim 1, characterized in that, The method further includes: In response to a resource object creation command, determine the associated node corresponding to the target resource object to be created; Bind the target resource object to the associated node; Based on the target resource object and the associated node, generate the memory object information corresponding to the target resource object; Create the target resource object on the associated node.
3. The resource processing method according to claim 2, characterized in that, The method further includes: When the target resource object is successfully created, the memory resource information occupied by the target resource object in the associated node, as well as the running status of the target resource object, are added to the memory object information corresponding to the target resource object.
4. The resource processing method according to claim 1, characterized in that, The method further includes: When an abnormal event of a resource object is detected, the target node associated with the abnormal resource object is marked as abnormal. When a resource object creation instruction is received, a resource object is created in the data nodes other than the target node that has been marked as abnormal.
5. A resource processing device, characterized in that, include: The exception event listening module is used to listen for exception events of resource objects at data nodes; The data node includes multiple resource objects; the resource objects are containers. The exception information determination module is used to determine the object identifier of the abnormal resource object carried by the abnormal resource object event and the object exception type when an abnormal event of a resource object is detected. The target node resource determination module is used to determine the target node resource where the abnormal resource object is located based on the object identifier of the abnormal resource object and the memory object information corresponding to the abnormal resource object; the memory object information corresponding to the abnormal resource object is used to point to the target node associated with the abnormal resource object; The resource processing module is used to perform resource processing operations corresponding to the exception type of the abnormal resource object based on the target node resources. The resource processing module includes: The unbinding module is used to perform an unbinding operation on the abnormal resource object and the target node when the object exception type is a resource object creation exception, and the target node resource is the target node bound to the abnormal resource object. The first processing module is configured to, when the object exception type is a resource object exception that has not been reclaimed, the target node resource is the target memory resource occupied by the exception resource object on the target node; and to perform a first destruction operation on the exception resource object in the target memory resource; the first destruction operation is configured to perform a destruction operation on the exception resource object when the process in the exception resource object has finished executing; The second processing module is configured to: when the object exception type is a resource object recycling exception, the resource object recycling exception includes failure to destroy the exception resource object based on the first destruction operation; perform a second destruction operation on the exception resource object; the second destruction operation is used to perform the destruction operation on the exception resource object when terminating a process in the normal state of the exception resource object; when the destruction of the exception resource object based on the second destruction operation fails, reset the target node; the method of resetting the target node includes recording the exception resource object and the target node where the exception resource object is located in the pipeline, waiting for the node to restart or reinstall, and completing the fallback recycling of the exception resource object.
6. The apparatus according to claim 5, characterized in that, The device further includes: The instruction response module is used to respond to resource object creation instructions and determine the associated node corresponding to the target resource object to be created; A binding module is used to bind the target resource object to the associated node; The memory object information generation module is used to generate memory object information corresponding to the target resource object based on the target resource object and the associated node; The first creation module is used to create the target resource object on the associated node.
7. The apparatus according to claim 6, characterized in that, The device further includes: The information adding module is used to add the memory resource information occupied by the target resource object in the associated node and the running status of the target resource object to the memory object information corresponding to the target resource object when the target resource object is successfully created.
8. The apparatus according to claim 5, characterized in that, The device further includes: The exception marking module is used to mark the target node associated with the exception resource object as an exception when an exception event of a resource object is detected. The second creation module is used to create resource objects in data nodes other than the target node that is marked as abnormal when a resource object creation instruction is received.
9. A device, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the resource processing method as described in any one of claims 1 to 4.
10. A computer storage medium, characterized in that, The storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the resource processing method as described in any one of claims 1 to 4.
11. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the resource processing method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Process fault processing method and device based on container technology
CN104915263A
Container management and control method and processing node
CN111552543A