Resource processing system and method

By using the resource coordination module and thread module in the resource processing system, security risks and resource consumption problems caused by the dependence of task scheduling decisions in the cloud environment are solved, and efficient and secure transaction processing is achieved.

CN114610485BActive Publication Date: 2025-05-02ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210211124.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-03
Publication Date
2025-05-02
Estimated Expiration
2042-03-03

AI Technical Summary

Technical Problem

In a cloud environment, the CPU's task scheduler needs to implement resource scheduling or load balancing, but scheduling decisions between different tasks may depend on each other, resulting in increased security risks and resource consumption.

Method used

A resource processing system is provided to detect a shared data structure through a resource coordination module to obtain pending transactions and determine at least two associated thread modules. Each thread module receives a transaction processing request, determines the thread status information and feeds it back to the resource coordination module, and finally performs transaction processing based on the integrated thread status information.

Benefits of technology

Improves the security and efficiency of transaction processing, reduces resource consumption costs, and ensures that pending transactions are either executed by all threads or none of them.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114610485B_ABST
    Figure CN114610485B_ABST
Patent Text Reader

Abstract

The embodiments of the present specification provide a resource processing system and method, wherein the resource processing system includes: a resource coordination module, configured to obtain a pending transaction by detecting a shared data structure; determine at least two thread modules associated with the pending transaction, and send a transaction processing request to each thread module; each thread module is configured to determine thread status information based on the transaction processing request, and feed back the thread status information to the resource coordination module; the resource coordination module is further configured to determine transaction processing information corresponding to the pending transaction based on the thread status information of each thread module, and send the transaction processing information to each thread module; each thread module is further configured to process the pending transaction based on the transaction processing information; wherein the physical resources to which each thread module belongs are the same.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the technical field of resource scheduling, and in particular, to a resource processing system and method. Background Art

[0002] With the development of Internet technology, cloud computing has been applied in more and more scenarios. It can not only support high-concurrency services, but also make full use of resources to complete transaction processing operations, becoming a widely used resource in existing technologies. In the cloud environment, if the CPU task scheduler needs to implement resource scheduling or load balancing, it needs to constantly interact with each CPU. In this environment, the scheduling decisions between different tasks may be dependent on each other; for example, on a machine with hyperthreading turned on, the virtual machine CPUs corresponding to two different virtual machines cannot run on two different hyperthreads on the same machine CPU at the same time. If this rule is violated, virtual machines can attack each other during task processing; it will not only consume a lot of scheduling resources, but also affect task security. Therefore, an effective solution is urgently needed to solve the above problems. Summary of the invention

[0003] In view of this, an embodiment of this specification provides a resource processing system. One or more embodiments of this specification simultaneously involve two resource processing methods, two resource processing devices, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.

[0004] According to a first aspect of an embodiment of this specification, a resource processing system is provided, including:

[0005] The resource coordination module is configured to obtain a pending transaction by detecting a shared data structure; determine at least two thread modules associated with the pending transaction, and send a transaction processing request to each thread module;

[0006] Each thread module is configured to determine thread state information based on the transaction processing request and feed the thread state information back to the resource coordination module;

[0007] The resource coordination module is further configured to determine the transaction processing information corresponding to the pending transaction according to the thread state information of each thread module, and send the transaction processing information to each thread module;

[0008] Each thread module is further configured to process the pending transaction based on the transaction processing information; wherein the physical resources to which each thread module belongs are the same.

[0009] According to a second aspect of an embodiment of this specification, a resource processing method is provided, which is applied to a resource coordination module, including:

[0010] Obtain pending transactions by detecting shared data structures;

[0011] Determine at least two thread modules associated with the to-be-processed transaction, and send a transaction processing request to each thread module;

[0012] receiving thread status information fed back by each thread module in response to the transaction processing request;

[0013] Transaction processing information corresponding to the to-be-processed transaction is determined based on the thread state information, and the transaction processing information is sent to each thread module.

[0014] According to a third aspect of an embodiment of this specification, another resource processing method is provided, which is applied to a thread module, and includes:

[0015] receiving a transaction processing request sent by a resource coordination module for a pending transaction;

[0016] Determine thread status information according to the transaction processing request, and feed back the thread status information to the resource coordination module;

[0017] Receiving transaction processing information fed back by the resource coordination module with respect to the thread state information;

[0018] The pending transaction is processed based on the transaction processing information.

[0019] According to a fourth aspect of the embodiments of this specification, a resource processing device is provided, which is applied to a resource coordination module, including:

[0020] A transaction detection unit is configured to obtain a pending transaction by detecting a shared data structure;

[0021] A determining thread unit is configured to determine at least two thread modules associated with the to-be-processed transaction and send a transaction processing request to each thread module;

[0022] An information receiving unit, configured to receive thread status information fed back by each thread module in response to the transaction processing request;

[0023] The information sending unit is configured to determine the transaction processing information corresponding to the pending transaction based on the thread state information, and send the transaction processing information to each thread module.

[0024] According to a fifth aspect of an embodiment of this specification, a resource processing device is provided, which is applied to a thread module, including:

[0025] A request receiving unit, configured to receive a transaction processing request sent by the resource coordination module for a pending transaction;

[0026] an information determination unit, configured to determine thread state information according to the transaction processing request, and feed back the thread state information to the resource coordination module;

[0027] An information receiving unit, configured to receive transaction processing information fed back by the resource coordination module with respect to the thread state information;

[0028] The transaction processing unit is configured to process the pending transaction based on the transaction processing information.

[0029] According to a sixth aspect of an embodiment of this specification, a computing device is provided, including:

[0030] Memory and processor;

[0031] The memory is used to store computer executable instructions, and the processor is used to implement the steps of the above resource processing method when executing the computer executable instructions.

[0032] According to a seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned resource processing method are implemented.

[0033] According to an eighth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned resource processing method.

[0034] In the resource processing system provided in this specification, when the resource coordination module obtains pending transactions by detecting a shared data structure, in order to improve transaction processing efficiency and reduce resource consumption costs, at least two thread modules associated with the pending transactions can be determined, and the physical resources to which each thread module belongs are the same; then a transaction processing request is sent to each thread module respectively, and each thread module can determine thread status information according to the transaction processing request, and feed it back to the resource coordination module; the resource coordination module can determine the transaction processing information of the pending transaction by integrating the thread status information of each thread module, and feed the transaction processing information back to each thread module, and finally each thread module can process the pending transaction according to the transaction processing information. When performing transaction processing, the thread status of each thread module can be counted by the resource coordination module to determine whether to process the pending transaction, and during the processing, a unified decision will be adopted to ensure that the pending transaction is either executed by all threads or not executed by all threads, thereby improving the transaction processing security while improving the transaction processing efficiency to reduce resource consumption costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a structural diagram of a resource processing system provided by an embodiment of this specification;

[0036] Figure 2 is a flow chart of a resource processing method provided by an embodiment of this specification;

[0037] Figure 3 is a flow chart of another resource processing method provided by an embodiment of this specification;

[0038] Figure 4 is a schematic diagram of the structure of a resource processing device provided by an embodiment of this specification;

[0039] Figure 5 is a schematic diagram of the structure of another resource processing device provided by an embodiment of this specification;

[0040] Figure 6 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0041] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0042] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0043] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0044] First, the terms involved in one or more embodiments of this specification are explained.

[0045] CPU: (Central Processing Unit) is the computing and control core of the computer system and the final execution unit for information processing and program running.

[0046] Hyperthreading: A technology that simulates multiple logical threads on a CPU, simulating a multi-threaded processor physical chip into two logical CPUs, allowing a single processor to use thread-level parallel computing, and thus compatible with multi-threaded operating systems and software. Hyperthreading technology makes full use of idle CPU resources to complete more work in the same amount of time.

[0047] VM: (Virtual Machine) refers to a complete computer system with complete hardware system functions that is simulated by software and runs in a completely isolated environment. Any work that can be done in a physical computer can be done in a virtual machine. When creating a virtual machine in a computer, part of the hard disk and memory capacity of the physical machine needs to be used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent CMOS, hard disk and operating system, and can be operated on the virtual machine just like a physical machine.

[0048] vCPU: A virtual processor in a computer; the CPU inside a virtual machine relative to a physical CPU.

[0049] Cloud Computing: Cloud Computing is a type of distributed computing. It refers to breaking down huge data computing programs into countless small programs through the network "cloud", and then processing and analyzing these small programs through a system composed of multiple servers to obtain results and return them to users.

[0050] In this specification, a resource processing system is provided. This specification also involves two resource processing methods, two resource processing devices, a computing device, a computer-readable storage medium and a computer program, which are described in detail one by one in the following embodiments.

[0051] In actual applications, the CPU task scheduler needs to constantly answer two questions: which CPU the task should run on, and which task each CPU should run at the next moment. Generally speaking, each task is independent of each other. However, in a cloud environment, scheduling decisions between different tasks may depend on each other. For example, on an x86-64 machine with hyperthreading turned on, the vCPUs corresponding to two different VMs cannot run on two different hyperthreads on the same CPU at the same time; this is because tasks on different hyperthreads of the same CPU share certain resources on the CPU pipeline and cache. If this rule is violated, a malicious VM can exploit the vulnerability to attack another VM. However, the schedulers in the prior art are all implemented based on the setting that the scheduling decisions between tasks are independent of each other; although they can achieve the scheduling effect, they cannot solve the above problems, such as the scheduler CFS used by the Linux kernel.

[0052] CFS is a general scheduler, and its target application is all Linux processes and threads. Since the current mainstream virtualization solution uses QEMU-KVM, and in QEMU-KVM, each vCPU is a Linux task, it is feasible to use CFS to schedule vCPU. However, CFS does not distinguish between vCPU and ordinary tasks, so CFS cannot meet the unique requirements of virtualization environment. The improved version of CFS has taken into account the requirements of cloud environment. For example, the improved version of CFS can first schedule a vCPU on a hyperthread, and then notify the associated vCPU through a certain mechanism to perform the corresponding scheduling. But the problem here is that there may be a time difference between the two schedulings, because the scheduler usually relies on clock interrupts for scheduling and load balancing. Consider a CPU that generates 200 clock interrupts per second, then the maximum time difference is 5ms (the mathematical expectation is 2.5ms). This 5ms may be exploited by attackers, thus causing security risks.

[0053] If a small range of modifications are made on the basis of the scheduler CFS, it is easy to cause inconsistency problems, that is, the scheduling decision for multiple vCPUs may only take effect on some vCPUs. This inconsistency will lead to serious security risks. Therefore, an effective solution is urgently needed to solve the above problems.

[0054] In view of this, in the resource processing system provided by the specification, when the resource coordination module obtains the pending transaction by detecting the shared data structure, in order to improve the efficiency of transaction processing and reduce the resource consumption cost, at least two thread modules associated with the pending transaction can be determined, and the physical resources to which each thread module belongs are the same; then a transaction processing request is sent to each thread module respectively, and each thread module can determine the thread status information according to the transaction processing request, and feed it back to the resource coordination module; the resource coordination module can determine the transaction processing information of the pending transaction by integrating the thread status information of each thread module, and feed the transaction processing information back to each thread module, and finally each thread module can process the pending transaction according to the transaction processing information. When performing transaction processing, the thread status of each thread module can be counted by the resource coordination module to determine whether to process the pending transaction, and during the processing, a unified decision will be adopted to ensure that the pending transaction is either executed by all threads or not executed by all threads, thereby improving the transaction processing security while improving the transaction processing efficiency to reduce the resource consumption cost.

[0055] Figure 1 A schematic diagram of the structure of a resource processing system provided according to an embodiment of the present specification is shown. The resource processing system 100 includes a resource coordination module 110 and at least two thread modules 120. The thread modules 120 are thread module 1, thread module 2, ... thread module n, where n is a positive integer and n≥1. Specifically, the resource processing system 100 includes:

[0056] The resource coordination module 110 is configured to obtain a pending transaction by detecting a shared data structure; determine at least two thread modules associated with the pending transaction, and send a transaction processing request to each thread module;

[0057] Each thread module 120 is configured to determine thread state information based on the transaction processing request and feed the thread state information back to the resource coordination module;

[0058] The resource coordination module 110 is further configured to determine the transaction processing information corresponding to the pending transaction according to the thread state information of each thread module, and send the transaction processing information to each thread module;

[0059] Each thread module 120 is further configured to process the pending transaction based on the transaction processing information; wherein the physical resources to which each thread module belongs are the same.

[0060] Specifically, the resource coordination module refers to the module responsible for coordinating different hyperthreads in the cloud computing environment, that is, the CPU with hyperthreading turned on; correspondingly, the thread module refers to the module corresponding to the hyperthreading turned on by the resource coordination module, which is used to run the vCPU of the virtual machine to process the transactions to be processed. In other words, the resource coordination module is the CPU with hyperthreading turned on; correspondingly, each thread module is the hyperthread running the virtual machine.

[0061] Accordingly, the shared data structure specifically refers to a queue, array or binary tree for storing pending transactions, etc., which can be set according to the actual application scenario when applied specifically, and this embodiment does not make any limitation here; accordingly, pending transactions specifically refer to transactions that need to be executed in a cloud computing environment, that is, transactions that resource users need to run using cloud computing resources, and corresponding project services are realized by running the transactions. Accordingly, the transaction processing request specifically refers to a request sent to each thread module to process pending transactions, and each thread module will respond to the resource scheduler to schedule the vCPUs corresponding to different virtual machines in the same CPU according to the transaction processing request, so as to realize the running of pending transactions through the vCPUs corresponding to the virtual machines.

[0062] It should be noted that in order to ensure the security of transaction execution and improve resource utilization, the physical resources to which each thread module belongs are the same, that is, the hyperthreads that execute the transactions to be processed belong to the same CPU, and the resources scheduled by each hyperthread belong to the vCPUs corresponding to different virtual machines in the CPU.

[0063] Accordingly, the thread status information specifically refers to the status information of whether the thread module can process pending transactions at the current moment; accordingly, the transaction processing information specifically refers to the information determined by the resource coordination module based on the thread status information fed back by each thread module, which is used to determine whether the hyperthreading needs to call resources at the same time to process pending transactions. It needs to maintain consistency, that is, when the thread status information corresponding to all hyperthreads is in the state of being able to execute pending transactions, it is determined that resources need to be scheduled to process pending transactions; or when the thread status information corresponding to any hyperthread is in the state of being unable to execute pending transactions, it is determined that pending transactions will not be processed at the current moment, that is, when ensuring resource scheduling or load balancing, the hyperthreads under the same CPU can be processed at the same time or not. Accordingly, processing pending transactions means executing pending transactions through vCPU resources to realize front-end project operation.

[0064] Based on this, when the scheduler performs resource scheduling or load balancing, in order to ensure the security of transaction execution while improving resource utilization; the resource coordination module can first determine the pending transactions by detecting the shared data structure, and determine that the resource scheduler needs to execute the pending transactions based on the detection results. At this time, in order to ensure the completion of the pending transactions and improve resource utilization, at least two hyper-threads corresponding to the pending transactions can be determined first, and the determined hyper-threads belong to the same CPU, and then the transaction processing request corresponding to the pending transactions is sent to each hyper-thread, that is, each hyper-thread needs to execute the pending transactions at the same time.

[0065] After each hyperthread receives the transaction processing request corresponding to the pending transaction, considering that each hyperthread belongs to the same CPU and corresponds to different virtual machines, each hyperthread may be running other transactions. In order to ensure the security of transaction execution, each hyperthread can feedback thread status information to the resource coordination module based on the current status information. After obtaining the thread status information fed back by each hyperthread, the resource coordination module can create transaction processing information based on the status of each hyperthread to determine whether it is necessary to run the pending transaction through the hyperthread scheduled at the current moment; that is, to ensure simultaneous execution or non-execution; then send transaction processing information to each hyperthread, and finally the hyperthread can process the pending transaction according to the transaction processing information to complete the operation of the corresponding transaction processing information.

[0066] This embodiment uses load balancing as an example to illustrate the above resource processing method; for example, VM0 and VM1 are created under the same CPU, wherein VM0 corresponds to vCPU0, and VM1 corresponds to vCPU1, and the CPU has hyperthreading mode turned on, so vCPU0 will run on hyperthread HT-x, and vCPU1 will run on hyperthread HT-y; based on this, according to the scheduling result of the resource scheduler, it is determined that the pending transaction needs to be run through vCPU0 and vCPU1, and the hyperthreads HT-x and HT-y are in a running state; then at this time, it can be determined according to the scheduling result that the hyperthread HT-s needs to be used to run vCPU0, and accordingly, the hyperthread HT-t belonging to the same CPU as the hyperthread HT-s will run vCPU1, so as to realize the operation of corresponding resources in combination with the hyperthreads under the same CPU and complete the execution of the pending transaction.

[0067] Furthermore, the scheduler of the hyperthread HT-s initiates pending transactions of the form vCPU0->HT-s and vCPU1->HT-t to the CPU. At this time, the CPU determines that the hyperthreads HT-s and HT-t are going to run the pending transactions, and sends transaction processing requests to each hyperthread. Since HT-s decides to run vCPU0, the CPU can assume that the thread status information fed back by the hyperthread HT-s is OK, and then it will receive the thread status information fed back by the hyperthread HT-t.

[0068] When the thread status information of the hyperthread HT-t and the thread status information of the hyperthread HT-s are both OK, it means that the pending transaction can be executed, and the CPU will feedback the transaction execution information to the hyperthreads HT-s and HT-t respectively, and the hyperthreads HT-s and HT-t will respectively schedule resources vCPU0 and vCPU1 to process the pending transaction according to the transaction execution information.

[0069] When the thread status information of the hyperthread HT-t is inconsistent with the thread status information of the hyperthread HT-s, it means that the thread status information of the hyperthread HT-t is Abort, that is, the hyperthread HT-t cannot execute the pending transaction at the current moment, then the CPU will feedback the transaction interruption information to the hyperthreads HT-s and HT-t respectively, and the hyperthreads HT-s and HT-t will give up executing the pending transaction according to the transaction interruption information, that is, the resources vCPU0 and vCPU1 will not be scheduled, and the hyperthreads HT-x and HT-y will continue to run the resources vCPU0 and vCPU1 to implement the processing operation of the pending transaction.

[0070] It should be noted that when performing resource scheduling, the same or corresponding description content in the above embodiment can also be used to complete resource processing, and this embodiment will not be described in detail here.

[0071] In summary, when the resource coordination module obtains pending transactions by detecting the shared data structure, in order to improve transaction processing efficiency and reduce resource consumption costs, at this time, at least two thread modules associated with the pending transactions can be determined, and the physical resources to which each thread module belongs are the same; then, a transaction processing request is sent to each thread module respectively, and each thread module can determine the thread status information according to the transaction processing request, and feed it back to the resource coordination module; the resource coordination module can determine the transaction processing information of the pending transaction by integrating the thread status information of each thread module, and feed the transaction processing information back to each thread module, and finally each thread module can process the pending transaction according to the transaction processing information. When performing transaction processing, the thread status of each thread module can be counted by the resource coordination module to determine whether to process the pending transaction, and during the processing, a unified decision will be adopted to ensure that the pending transaction is either executed by all threads or not executed by all threads, thereby improving the transaction processing security while improving the transaction processing efficiency to reduce resource consumption costs.

[0072] Furthermore, in a cloud computing environment, if it is necessary to complete the execution processing operation of the pending transaction through the thread module, it needs to be completed through the resource scheduler; that is, the resource scheduler needs to complete resource scheduling or load balancing first, and then perform subsequent transaction processing operations based on the scheduling results; that is, the resource processing system also includes a resource scheduler; the resource scheduler is configured to receive the pending transaction; configure the resources to be used for the pending transaction, and create resource scheduling information based on the configuration results; and write the pending transaction carrying the resource scheduling information into the shared data structure.

[0073] Specifically, the resource scheduler refers to a processor that schedules executable resources in a cloud computing environment in order to improve resource utilization, and is used to achieve resource scheduling and load balancing; correspondingly, the resources to be used specifically refer to the available resources allocated by the resource scheduler to the pending transactions based on the resource operation status feedback from each node; correspondingly, the resource scheduling information specifically refers to the information created after the pending transactions are allocated with the pending resources, which is used to inform the resource coordination module which resources need to be used for the subsequent processing of the pending transactions.

[0074] Based on this, when the resource scheduler determines that pending transactions need to be executed, it can first specify the resources to be used for the pending transactions, that is, specify a batch of scheduling or a batch of load balancing decisions, and create resource scheduling information based on the configuration results of the resources to be used, and write the pending transactions carrying the resource scheduling information into a shared data structure, so that the resource coordination module that subsequently connects to the resource scheduler can determine the pending transactions that need to be executed through the shared data structure and complete subsequent processing operations.

[0075] In summary, in order to support subsequent transaction processing operations, the resource scheduling information can be created through the resource scheduler and written into the shared data structure, so that the subsequent resource coordination module can start the processing mechanism of the pending transactions by detecting the shared data module and complete the processing of the pending transactions.

[0076] Furthermore, after writing the pending transaction carrying the resource scheduling information into the shared data structure, the resource coordination module will determine the pending transaction by detecting the shared data structure. In this process, since the pending transaction carries the resource scheduling information, the resource coordination module can combine the resource scheduling information when determining the thread. In this embodiment, the resource coordination module is further configured to obtain the pending transaction carrying the resource scheduling information by detecting the shared data structure; determine the at least two thread modules associated with the pending transaction according to the resource scheduling information; and send the transaction processing request to each thread module when determining that the pending transaction is in a pending state.

[0077] Specifically, when the resource scheduler writes the pending transaction carrying resource reading information into the shared data structure, it means that the decision information of the resources to be used allocated for the pending transaction can be determined by detecting the shared data structure. At this time, the resource coordination module can obtain the pending transaction carrying resource scheduling information by detecting the shared data structure. Then, the resource coordination module can determine at least two hyperthreads to execute the pending transaction based on the resource scheduling information. When the resource coordination module determines that the resource scheduler needs to execute the pending transaction, it means that the pending transaction is in a pending state, and a transaction processing request corresponding to the pending transaction can be sent to each hyperthread, so that each hyperthread can feedback transaction processing information based on the specific thread state information.

[0078] In this process, in order to improve the security of transaction processing, that is, to avoid mutual attacks between different virtual machines under the same CPU, a thread module belonging to the same physical resource can be selected as the thread module for executing the transaction to be processed; the resource coordination module is further configured to select the transaction thread module associated with the transaction to be processed according to the resource scheduling information, and determine the physical resource to which the transaction thread module belongs; select at least one associated thread module associated with the transaction thread module from the physical resource; and form the at least two thread modules associated with the transaction to be processed based on the transaction thread module and the at least one associated thread module.

[0079] Specifically, the transaction thread module specifically refers to a hyper-thread in an idle hyper-thread that can process the pending transaction; correspondingly, the physical resource specifically refers to the CPU to which the thread module belongs; correspondingly, the associated thread module specifically refers to other hyper-threads that belong to the same physical resource as the transaction thread module. By selecting the hyper-thread belonging to the same physical resource to determine the thread module associated with the pending transaction, the security of the environment when executing the pending transaction can be guaranteed, and at the same time, the computing resources can be fully utilized to improve the transaction processing efficiency.

[0080] Based on this, the resource coordination module will first determine the transaction thread module that can execute the pending transaction according to the resource scheduling information. Then, in order to ensure the security of transaction processing, the powerless resources to which the transaction thread module belongs can be determined at this time. Then, at least one associated thread module associated with the transaction thread module is selected from the physical resources. The transaction thread module and at least one associated thread module are combined to form at least two thread modules corresponding to the pending transaction, which can be used to complete the processing of the pending transaction through at least two thread modules in the future, thereby ensuring transaction processing efficiency.

[0081] Using the above example, when the resource scheduler determines that load balancing is required for pending transactions, it can first allocate resources vCPU0 and vCPU1 for pending transactions; then create resource scheduling information based on the resource configuration result, and write the pending transactions carrying resource scheduling information into the shared data structure. The CPU detects the shared data structure and determines that resources vCPU0 and vCPU1 are needed to process pending transactions. At this time, the hyperthread HT-s running resource vCPU0 is determined based on the resource scheduling information, and then another hyperthread HT-t belonging to the same CPU as the hyperthread HT-s is determined. The target hyperthread for processing pending transactions is composed based on the hyperthreads HT-s and HT-t, so as to run resources vCPU0 and vCPU1 respectively in the future to process pending transactions.

[0082] In summary, by selecting thread modules corresponding to the same physical resource to form at least two pending transactions associated with the pending transactions, not only can the security of subsequent processing of the pending transactions be guaranteed, but also the transaction processing efficiency can be improved, thereby achieving improved resource utilization.

[0083] Furthermore, when the resource coordination module determines that the resource scheduler needs to execute a pending transaction, the resource coordination module needs to send a transaction processing request to the thread module that executes the pending transaction. During this process, in order to ensure that each thread module can respond to the transaction processing request in a timely manner and make feedback, the creation of the transaction processing request can be completed in combination with an interrupt request of resource preparation information associated with the pending transaction; in this embodiment, the resource coordination module is further configured to determine the resource preparation information for each thread module respectively, create an interrupt request carrying the resource preparation information as the transaction processing request, and send it to each thread module.

[0084] Specifically, the resource preparation information specifically refers to the preparation information that notifies each thread module that it needs to process the pending transaction, and each thread module can respond to the resource preparation information to feedback whether the pending transaction can be processed at the current moment; correspondingly, the interrupt request specifically refers to the inter-core interrupt that carries the resource preparation information, which is used to interrupt the operation of each thread module.

[0085] Based on this, when the resource coordination module determines that there are at least two thread modules associated with the pending transaction, resource preparation information can be created for each thread module to notify each thread module that it needs to execute the pending transaction; then an inter-core interrupt carrying the resource preparation information is created and sent to each thread module as a transaction processing request, so that each thread module can respond to the operation of executing the pending transaction in a timely manner based on the inter-core interrupt.

[0086] In summary, by creating an interrupt request carrying resource preparation information as a transaction processing request, each thread module can respond to the transaction processing request in a timely manner after receiving the transaction processing request, thereby effectively improving the transaction processing efficiency.

[0087] Furthermore, after receiving the interrupt request carrying the resource preparation information, each thread module will respond to the interrupt request as soon as possible; in this embodiment, each thread module is further configured to receive the interrupt request carrying the resource preparation information, and call the interrupt processing function according to the interrupt request; the resource preparation information is processed by the interrupt processing function, and the thread status information is determined according to the information processing result.

[0088] Specifically, the interrupt processing function refers to a function that can feedback thread status information to the resource coordination module based on resource preparation information. The thread status information fed back is used to characterize the execution status of the thread module at the current moment. The thread status information is OK and Abort, respectively. The thread status information OK indicates that the thread module agrees to execute the pending transaction; the thread status information Abort indicates that the thread module refuses to execute the pending transaction due to some reason.

[0089] Based on this, when the thread module receives an inter-core interrupt carrying resource preparation information, no matter what state the thread module is processing, the interrupt processing function will be called according to the inter-core interrupt, and then the resource preparation information will be processed by the interrupt processing function to determine the thread status information corresponding to the thread module at the current moment, and the thread status information will be fed back to the resource coordination module, so that the resource coordination module can make corresponding operations according to the thread status information fed back by each thread module.

[0090] Continuing with the above example, after the CPU determines the hyper-threads HT-s and HT-t associated with the transaction to be processed, it can create Prepare for each hyper-thread, and then integrate it into the inter-core interrupt and send it to the hyper-threads HT-s and HT-t; the hyper-threads HT-s and HT-t receive the inter-core interrupt carrying Prepare, call the interrupt processing function, and then determine whether the thread status information is OK or Abort according to the interrupt processing function, and feed it back to the CPU for subsequent transaction processing operations.

[0091] In summary, by using inter-core interrupts to carry resource preparation information for transaction requests, each thread module can quickly respond to the inter-core interrupts and provide feedback, so as to ensure that when the thread status information corresponding to each thread module is in an executable state, the processing operation of the transaction to be processed can be completed quickly.

[0092] Furthermore, when each thread module communicates information with the resource coordination module, in order to cope with complex communication scenarios, the information communication can be completed through the information sharing unit; in this embodiment, each thread module is also configured to write the thread state information into the information sharing unit;

[0093] Correspondingly, the resource coordination module is further configured to determine the thread status information corresponding to each thread module by polling the information sharing unit; determine the transaction processing information corresponding to the to-be-processed transaction according to the thread status information corresponding to each thread module, and write the transaction processing information into the information sharing unit;

[0094] Correspondingly, each thread module is further configured to determine the transaction processing information by polling the information sharing unit, and process the pending transaction based on the transaction processing information.

[0095] Specifically, the information sharing unit refers to the shared variables used for communication between the thread module and the resource coordination module, including but not limited to the network, memory, local area network, etc.; that is, it is used to support each thread module to quickly connect to the resource coordination module; accordingly, when the information is written to the information sharing unit, the variables in the information sharing unit will change, and the resource coordination module or thread module that polls the information sharing unit can determine the information they need based on the changes in the variables.

[0096] Based on this, after each hyperthread determines its corresponding thread status information according to the transaction processing request, the thread status information can be written into the information sharing unit; then the resource coordination module will continuously poll the information sharing unit. When the information sharing unit is completed by each hyperthread, the resource coordination module will determine the thread status information corresponding to each hyperthread according to the polling result, and then the transaction processing information can be determined according to the thread status information fed back by each hyperthread to decide whether to process the pending transaction; then, since the operation of processing the transaction is completed by each hyperthread, the transaction processing information needs to be written into the information sharing unit. Finally, each hyperthread can determine the transaction processing information by polling the information sharing unit, and process the pending transaction according to the transaction processing information.

[0097] Taking the thread status information OK that the hyperthreads HT-s and HT-t need to feedback as an example, the process of transmitting messages through the information sharing unit is described; the hyperthreads HT-s and HT-t will write the thread status information OK to the shared variables respectively at this time; then the CPU determines whether the hyperthreads HT-s and HT-t agree to execute the pending transactions by polling the shared variables, and according to the polling results, it is determined that the thread status information feedback by the hyperthreads HT-s and HT-t are both OK, then the transaction execution information Commit can be created at this time and written into the shared variables; the hyperthreads HT-s and HT-t determine that the transaction execution information is Commit by polling the shared variables, and can schedule the resources vCPU0 and vCPU1 to process the pending transactions respectively according to the transaction execution information Commit.

[0098] In summary, by establishing a communication link between each thread module and the resource coordination module based on the information sharing unit, each thread module and the resource coordination module can quickly determine the mutual feedback information to improve transaction processing efficiency and reduce information transmission time.

[0099] In the specific implementation, it is considered that each thread module will complete the pending transaction according to the transaction processing information fed back by the resource coordination module. In this process, in order to ensure the security of transaction processing, each thread module needs to be in a usable state to be implemented; in this embodiment, the resource coordination module is further configured to determine that the at least two thread modules are in a usable state according to the thread state information corresponding to each thread module, create transaction execution information as the transaction processing information according to the usable state, and write the transaction processing information into the information sharing unit;

[0100] Correspondingly, each thread module is further configured to determine the transaction execution information by polling the information sharing unit, determine the target resource according to the transaction execution information, and write the target resource into the resource scheduling queue; when the target resource meets the transaction processing condition of the resource scheduling queue, the pending transaction is processed through the target resource.

[0101] Specifically, the available state specifically refers to that the thread module can process the pending transaction; correspondingly, the transaction execution information specifically refers to that all thread modules agree to process the pending transaction; correspondingly, the target resource specifically refers to the resource that the thread module needs to run to process the pending transaction; correspondingly, the resource scheduling queue specifically refers to the queue corresponding to the thread module, which is used to standardize the queue of the target resources to be run. Correspondingly, the transaction processing condition specifically refers to the condition under which the target resource is run.

[0102] Based on this, the resource coordination module determines that each thread module is in a usable state according to the thread status information fed back by each thread module, which means that each thread module in at least two thread modules agrees to process the pending transaction. At this time, transaction execution information can be created as transaction processing information according to the usage status and written to the information sharing unit; each thread module determines that the thread modules associated with the pending transaction agree to process the pending transaction by polling the information sharing unit, then each thread module can determine the target resource for its own operation according to the transaction execution information, and write the target resource into the resource scheduling queue; and when the target resource meets the transaction processing condition of the resource scheduling queue, it means that the thread module can run the target resource, then the pending transaction can be processed through the target resource.

[0103] Using the above example, it is determined that the thread status information fed back by the hyperthreads HT-s and HT-t is OK. At this time, the CPU will create transaction execution information Commit according to the thread status information OK of each hyperthread and write it into the shared variable; the hyperthreads HT-s and HT-t determine that the transaction execution information is Commit by polling the shared variable, then the hyperthread HT-s will write the resource vCPU0 into its corresponding resource scheduling queue, and the hyperthread HT-t will write the resource vCPU1 into its corresponding resource scheduling queue; in the subsequent case where the transaction processing conditions are met, the pending transactions are processed by the resources vCPU0 and vCPU1.

[0104] On the other hand, in the case that any thread module cannot process the pending transaction, the resource coordination module is further configured to determine, according to the thread state information corresponding to each thread module, that at least one thread module is in a non-use state, create transaction interruption information as the transaction processing information according to the non-use state, and write the transaction processing information into the information sharing unit;

[0105] Correspondingly, each thread module is further configured to determine the transaction interruption information by polling the information sharing unit, determine at least two target thread modules according to the transaction interruption information, and send the to-be-processed transaction to the at least two target thread modules.

[0106] Specifically, the non-use state specifically refers to that the thread module cannot process the pending transaction at the current moment; correspondingly, the transaction interruption information specifically refers to the information that the resource coordinator cancels the processing of the pending transaction.

[0107] Based on this, the resource coordination module determines, based on the thread status information fed back by each thread module, that if the thread status information fed back by at least one thread module indicates that the thread module is in a non-use state, it means that at least one thread module is unable to process the pending transaction at the current moment. At this time, the resource coordination module can create transaction interruption information as transaction processing information based on the non-use state, and write it to the information sharing unit; when each thread module determines, by polling the information sharing unit, that other thread modules are unable to process the pending transaction, at this time, at least two target thread modules can be determined based on the transaction interruption information, and then the target thread modules process the pending transaction.

[0108] Using the above example, when the thread status information of the hyperthread HT-t is inconsistent with the thread status information of the hyperthread HT-s, it means that the thread status information of the hyperthread HT-t is Abort, that is, the hyperthread HT-t cannot execute the pending transaction at the current moment, and the CPU will write the transaction interruption information Fail to the shared variable; the hyperthreads HT-s and HT-t determine the transaction interruption information Fail by polling the shared variable, and then it is determined that the hyperthreads HT-s and HT-t will give up executing the pending transaction according to the transaction interruption information Fail, that is, the resources vCPU0 and vCPU1 will not be scheduled, and the hyperthreads HT-x and HT-y can continue to run the resources vCPU0 and vCPU1 to implement the processing operation of the pending transaction.

[0109] In the resource processing system provided in this specification, when the resource coordination module obtains pending transactions by detecting a shared data structure, in order to improve transaction processing efficiency and reduce resource consumption costs, at least two thread modules associated with the pending transactions can be determined, and the physical resources to which each thread module belongs are the same; then a transaction processing request is sent to each thread module respectively, and each thread module can determine thread status information according to the transaction processing request, and feed it back to the resource coordination module; the resource coordination module can determine the transaction processing information of the pending transaction by integrating the thread status information of each thread module, and feed the transaction processing information back to each thread module, and finally each thread module can process the pending transaction according to the transaction processing information. When performing transaction processing, the thread status of each thread module can be counted by the resource coordination module to determine whether to process the pending transaction, and during the processing, a unified decision will be adopted to ensure that the pending transaction is either executed by all threads or not executed by all threads, thereby improving the transaction processing security while improving the transaction processing efficiency to reduce resource consumption costs.

[0110] Figure 2 A flow chart of a resource processing method provided according to an embodiment of the present specification is shown, which is applied to a resource coordination module and specifically includes the following steps.

[0111] Step S202, obtaining the pending transaction by detecting the shared data structure.

[0112] Step S204: determine at least two thread modules associated with the transaction to be processed, and send a transaction processing request to each thread module.

[0113] Step S206: receiving thread status information fed back by each thread module in response to the transaction processing request.

[0114] Step S208: determining transaction processing information corresponding to the pending transaction based on the thread status information, and sending the transaction processing information to each thread module.

[0115] In an optional embodiment, a pending transaction carrying resource scheduling information is obtained by detecting a shared data structure; at least two thread modules associated with the pending transaction are determined based on the resource scheduling information; and when it is determined that the pending transaction is in a pending state, a transaction processing request is sent to each thread module.

[0116] In an optional embodiment, resource preparation information is determined for each thread module respectively, an interrupt request carrying the resource preparation information is created as a transaction processing request, and sent to each thread module.

[0117] In an optional embodiment, each thread module writes thread state information into the information sharing unit;

[0118] Correspondingly, the resource coordination module determines the thread status information corresponding to each thread module by polling the information sharing unit; determines the transaction processing information corresponding to the pending transaction according to the thread status information corresponding to each thread module, and writes the transaction processing information into the information sharing unit;

[0119] Accordingly, each thread module determines the transaction processing information by polling the information sharing unit, and processes the pending transaction based on the transaction processing information.

[0120] In an optional embodiment, when the resource coordination module determines that at least two thread modules are in an available state according to the thread state information corresponding to each thread module, the resource coordination module creates transaction execution information as transaction processing information according to the available state, and writes the transaction processing information into the information sharing unit;

[0121] Correspondingly, each thread module determines transaction execution information by polling the information sharing unit, determines the target resource according to the transaction execution information, and writes the target resource into the resource scheduling queue; when the target resource meets the transaction processing conditions of the resource scheduling queue, the pending transaction is processed by the target resource.

[0122] In an optional embodiment, when the resource coordination module determines that at least one thread module is in a non-use state according to the thread state information corresponding to each thread module, the resource coordination module creates transaction interruption information as transaction processing information according to the non-use state, and writes the transaction processing information into the information sharing unit;

[0123] Accordingly, each thread module determines the transaction interruption information by polling the information sharing unit, determines at least two target thread modules according to the transaction interruption information, and sends the to-be-processed transaction to the at least two target thread modules.

[0124] In an optional embodiment, a transaction thread module associated with the transaction to be processed is selected based on resource scheduling information, and the physical resources to which the transaction thread module belongs are determined; at least one associated thread module associated with the transaction thread module is selected from the physical resources; and at least two thread modules associated with the transaction to be processed are formed based on the transaction thread module and the at least one associated thread module.

[0125] In summary, when the resource coordination module obtains pending transactions by detecting a shared data structure, in order to improve transaction processing efficiency and reduce resource consumption costs, at least two thread modules associated with the pending transaction can be determined according to the resource scheduling information carried in the pending transaction, and the physical resources to which each thread module belongs are the same; then, when it is determined that the pending transaction is in a pending execution state, a transaction processing request is sent to each thread module respectively, and each thread module can determine the thread status information according to the transaction processing request and feed it back to the resource coordination module; the resource coordination module can determine the transaction processing information of the pending transaction by integrating the thread status information of each thread module, and feed the transaction processing information back to each thread module, and finally each thread module can process the pending transaction according to the transaction processing information. When performing transaction processing, the thread status of each thread module can be counted by the resource coordination module to determine whether to process the pending transaction, and during the processing, a unified decision will be adopted to ensure that the pending transaction is either executed by all threads or not executed by all threads, thereby improving the transaction processing security while improving the transaction processing efficiency to reduce resource consumption costs.

[0126] The above is a schematic scheme of a resource processing method of this embodiment. It should be noted that the technical scheme of the resource processing method and the technical scheme of the resource processing system described above are of the same concept, and the details not described in detail in the technical scheme of the resource processing method can be referred to the description of the technical scheme of the resource processing system described above.

[0127] Figure 3 A flowchart of another resource processing method provided according to an embodiment of the present specification is shown, which is applied to a thread module and specifically includes the following steps.

[0128] Step S302: receiving a transaction processing request sent by a resource coordination module for a transaction to be processed.

[0129] Step S304: determining thread status information according to the transaction processing request, and feeding back the thread status information to the resource coordination module.

[0130] Step S306: receiving transaction processing information fed back by the resource coordination module in response to the thread state information.

[0131] Step S308: Process the pending transaction based on the transaction processing information.

[0132] In an optional embodiment, an interrupt request carrying resource preparation information is received, and an interrupt processing function is called according to the interrupt request; the resource preparation information is processed by the interrupt processing function, and the thread state information is determined according to the information processing result.

[0133] In an optional embodiment, each thread module writes thread state information into the information sharing unit;

[0134] Correspondingly, the resource coordination module determines the thread status information corresponding to each thread module by polling the information sharing unit; determines the transaction processing information corresponding to the pending transaction according to the thread status information corresponding to each thread module, and writes the transaction processing information into the information sharing unit;

[0135] Accordingly, each thread module determines the transaction processing information by polling the information sharing unit, and processes the pending transaction based on the transaction processing information.

[0136] In an optional embodiment, when the resource coordination module determines that at least two thread modules are in an available state according to the thread state information corresponding to each thread module, the resource coordination module creates transaction execution information as transaction processing information according to the available state, and writes the transaction processing information into the information sharing unit;

[0137] Correspondingly, each thread module determines transaction execution information by polling the information sharing unit, determines the target resource according to the transaction execution information, and writes the target resource into the resource scheduling queue; when the target resource meets the transaction processing conditions of the resource scheduling queue, the pending transaction is processed by the target resource.

[0138] In an optional embodiment, when the resource coordination module determines that at least one thread module is in a non-use state according to the thread state information corresponding to each thread module, the resource coordination module creates transaction interruption information as transaction processing information according to the non-use state, and writes the transaction processing information into the information sharing unit;

[0139] Accordingly, each thread module determines the transaction interruption information by polling the information sharing unit, determines at least two target thread modules according to the transaction interruption information, and sends the to-be-processed transaction to the at least two target thread modules.

[0140] In summary, when the resource coordination module obtains pending transactions by detecting a shared data structure, in order to improve transaction processing efficiency and reduce resource consumption costs, at least two thread modules associated with the pending transaction can be determined according to the resource scheduling information carried in the pending transaction, and the physical resources to which each thread module belongs are the same; then, when it is determined that the pending transaction is in a pending execution state, a transaction processing request is sent to each thread module respectively, and each thread module can determine the thread status information according to the transaction processing request and feed it back to the resource coordination module; the resource coordination module can determine the transaction processing information of the pending transaction by integrating the thread status information of each thread module, and feed the transaction processing information back to each thread module, and finally each thread module can process the pending transaction according to the transaction processing information. When performing transaction processing, the thread status of each thread module can be counted by the resource coordination module to determine whether to process the pending transaction, and during the processing, a unified decision will be adopted to ensure that the pending transaction is either executed by all threads or not executed by all threads, thereby improving the transaction processing security while improving the transaction processing efficiency to reduce resource consumption costs.

[0141] The above is a schematic scheme of another resource processing method of this embodiment. It should be noted that the technical scheme of the resource processing method and the technical scheme of the resource processing system described above are of the same concept, and the details not described in detail in the technical scheme of the resource processing method can be referred to the description of the technical scheme of the resource processing system described above.

[0142] Corresponding to the above method embodiment, this specification also provides a resource processing device embodiment, Figure 4 FIG. 1 shows a schematic diagram of the structure of a resource processing device provided by an embodiment of the present specification. Figure 4 As shown, the device is applied to a resource coordination module, comprising:

[0143] A transaction detection unit 402 is configured to obtain a pending transaction by detecting a shared data structure;

[0144] A thread determination unit 404 is configured to determine at least two thread modules associated with the transaction to be processed, and send a transaction processing request to each thread module;

[0145] An information receiving unit 406 is configured to receive thread status information fed back by each thread module in response to the transaction processing request;

[0146] The information sending unit 408 is configured to determine the transaction processing information corresponding to the pending transaction based on the thread state information, and send the transaction processing information to each thread module.

[0147] In an optional embodiment, the device also includes: obtaining a pending transaction carrying resource scheduling information by detecting a shared data structure; determining at least two thread modules associated with the pending transaction based on the resource scheduling information; and sending a transaction processing request to each thread module when it is determined that the pending transaction is in a pending execution state.

[0148] In an optional embodiment, the device further includes: determining resource preparation information for each thread module respectively, creating an interrupt request carrying the resource preparation information as a transaction processing request, and sending the interrupt request to each thread module.

[0149] In an optional embodiment, the device further comprises: each thread module writes the thread state information into the information sharing unit;

[0150] Correspondingly, the resource coordination module determines the thread status information corresponding to each thread module by polling the information sharing unit; determines the transaction processing information corresponding to the pending transaction according to the thread status information corresponding to each thread module, and writes the transaction processing information into the information sharing unit;

[0151] Accordingly, each thread module determines the transaction processing information by polling the information sharing unit, and processes the pending transaction based on the transaction processing information.

[0152] In an optional embodiment, the device further comprises: when the resource coordination module determines that at least two thread modules are in an available state according to the thread state information corresponding to each thread module, creating transaction execution information as transaction processing information according to the available state, and writing the transaction processing information into the information sharing unit;

[0153] Correspondingly, each thread module determines transaction execution information by polling the information sharing unit, determines the target resource according to the transaction execution information, and writes the target resource into the resource scheduling queue; when the target resource meets the transaction processing conditions of the resource scheduling queue, the pending transaction is processed by the target resource.

[0154] In an optional embodiment, the device further comprises: when the resource coordination module determines that at least one thread module is in a non-use state according to the thread state information corresponding to each thread module, creating transaction interruption information as transaction processing information according to the non-use state, and writing the transaction processing information into the information sharing unit;

[0155] Accordingly, each thread module determines the transaction interruption information by polling the information sharing unit, determines at least two target thread modules according to the transaction interruption information, and sends the to-be-processed transaction to the at least two target thread modules.

[0156] In an optional embodiment, the device also includes: selecting a transaction thread module associated with the transaction to be processed according to resource scheduling information, and determining the physical resources to which the transaction thread module belongs; selecting at least one associated thread module associated with the transaction thread module from the physical resources; and forming at least two thread modules associated with the transaction to be processed based on the transaction thread module and the at least one associated thread module.

[0157] In summary, when the resource coordination module obtains pending transactions by detecting a shared data structure, in order to improve transaction processing efficiency and reduce resource consumption costs, at least two thread modules associated with the pending transaction can be determined according to the resource scheduling information carried in the pending transaction, and the physical resources to which each thread module belongs are the same; then, when it is determined that the pending transaction is in a pending execution state, a transaction processing request is sent to each thread module respectively, and each thread module can determine the thread status information according to the transaction processing request and feed it back to the resource coordination module; the resource coordination module can determine the transaction processing information of the pending transaction by integrating the thread status information of each thread module, and feed the transaction processing information back to each thread module, and finally each thread module can process the pending transaction according to the transaction processing information. When performing transaction processing, the thread status of each thread module can be counted by the resource coordination module to determine whether to process the pending transaction, and during the processing, a unified decision will be adopted to ensure that the pending transaction is either executed by all threads or not executed by all threads, thereby improving the transaction processing security while improving the transaction processing efficiency to reduce resource consumption costs.

[0158] The above is a schematic scheme of a resource processing device of this embodiment. It should be noted that the technical scheme of the resource processing device and the technical scheme of the resource processing system described above are of the same concept, and the details not described in detail in the technical scheme of the resource processing device can be found in the description of the technical scheme of the resource processing system described above.

[0159] Corresponding to the above method embodiment, this specification also provides a resource processing device embodiment, Figure 5 FIG. 2 shows a schematic diagram of the structure of another resource processing device provided by an embodiment of the present specification. Figure 5 As shown, the device is applied to a thread module and includes:

[0160] A request receiving unit 502 is configured to receive a transaction processing request sent by a resource coordination module for a pending transaction;

[0161] An information determination unit 504 is configured to determine thread status information according to the transaction processing request, and feed the thread status information back to the resource coordination module;

[0162] An information receiving unit 506 is configured to receive transaction processing information fed back by the resource coordination module with respect to the thread state information;

[0163] The transaction processing unit 508 is configured to process the pending transaction based on the transaction processing information.

[0164] In an optional embodiment, the device further includes: receiving an interrupt request carrying resource preparation information, and calling an interrupt processing function according to the interrupt request; processing the resource preparation information through the interrupt processing function, and determining the thread status information according to the information processing result.

[0165] In an optional embodiment, the device further comprises: each thread module writes the thread state information into the information sharing unit;

[0166] Correspondingly, the resource coordination module determines the thread status information corresponding to each thread module by polling the information sharing unit; determines the transaction processing information corresponding to the pending transaction according to the thread status information corresponding to each thread module, and writes the transaction processing information into the information sharing unit;

[0167] Accordingly, each thread module determines the transaction processing information by polling the information sharing unit, and processes the pending transaction based on the transaction processing information.

[0168] In an optional embodiment, the device further comprises: when the resource coordination module determines that at least two thread modules are in an available state according to the thread state information corresponding to each thread module, creating transaction execution information as transaction processing information according to the available state, and writing the transaction processing information into the information sharing unit;

[0169] Correspondingly, each thread module determines transaction execution information by polling the information sharing unit, determines the target resource according to the transaction execution information, and writes the target resource into the resource scheduling queue; when the target resource meets the transaction processing conditions of the resource scheduling queue, the pending transaction is processed by the target resource.

[0170] In an optional embodiment, the device further comprises: when the resource coordination module determines that at least one thread module is in a non-use state according to the thread state information corresponding to each thread module, creating transaction interruption information as transaction processing information according to the non-use state, and writing the transaction processing information into the information sharing unit;

[0171] Accordingly, each thread module determines the transaction interruption information by polling the information sharing unit, determines at least two target thread modules according to the transaction interruption information, and sends the to-be-processed transaction to the at least two target thread modules.

[0172] In summary, when the resource coordination module obtains pending transactions by detecting a shared data structure, in order to improve transaction processing efficiency and reduce resource consumption costs, at least two thread modules associated with the pending transaction can be determined according to the resource scheduling information carried in the pending transaction, and the physical resources to which each thread module belongs are the same; then, when it is determined that the pending transaction is in a pending execution state, a transaction processing request is sent to each thread module respectively, and each thread module can determine the thread status information according to the transaction processing request and feed it back to the resource coordination module; the resource coordination module can determine the transaction processing information of the pending transaction by integrating the thread status information of each thread module, and feed the transaction processing information back to each thread module, and finally each thread module can process the pending transaction according to the transaction processing information. When performing transaction processing, the thread status of each thread module can be counted by the resource coordination module to determine whether to process the pending transaction, and during the processing, a unified decision will be adopted to ensure that the pending transaction is either executed by all threads or not executed by all threads, thereby improving the transaction processing security while improving the transaction processing efficiency to reduce resource consumption costs.

[0173] The above is a schematic scheme of another resource processing device of this embodiment. It should be noted that the technical scheme of the resource processing device and the technical scheme of the resource processing system described above are of the same concept, and the details of the technical scheme of the resource processing device that are not described in detail can be found in the description of the technical scheme of the resource processing system described above.

[0174] Figure 6 The block diagram of a computing device 600 according to an embodiment of the present specification is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.

[0175] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0176] In one embodiment of the present specification, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0177] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.

[0178] The processor 620 is used to execute the following computer executable instructions, which implement the steps of the above resource processing method when executed by the processor.

[0179] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the resource processing method described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the resource processing method described above.

[0180] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned resource processing method when executed by a processor.

[0181] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the resource processing method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the resource processing method described above.

[0182] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned resource processing method.

[0183] The above is an illustrative solution of a computer program of this embodiment. It should be noted that the technical solution of the computer program and the technical solution of the resource processing method described above are of the same concept, and the details not described in detail in the technical solution of the computer program can be found in the description of the technical solution of the resource processing method described above.

[0184] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0185] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0186] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0187] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0188] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A resource processing system, comprising: A resource coordination module is configured to obtain pending transactions by detecting a shared data structure; Determine at least two thread modules associated with the to-be-processed transaction, and send a transaction processing request to each thread module, wherein the resource coordination module is a CPU with hyperthreading enabled; Each thread module is configured to determine thread status information based on the transaction processing request and feed the thread status information back to the resource coordination module, wherein the thread status information refers to status information of whether each thread module can process the pending transaction at the current moment, and each thread module is a hyperthread running a virtual machine; The resource coordination module is further configured to determine the transaction processing information corresponding to the pending transaction according to the thread state information of each thread module, and send the transaction processing information to each thread module, wherein the transaction processing information means that when the thread state information corresponding to each thread module is in a state where the pending transaction can be executed, it is determined that resources need to be scheduled to process the pending transaction; Each thread module is further configured to process the pending transaction based on the transaction processing information; wherein the physical resources to which each thread module belongs are the same.

2. The system according to claim 1, further comprising a resource scheduler; the resource scheduler is configured to receive the pending transaction; configure the resources to be used for the pending transaction, and create resource scheduling information according to the configuration result; Writing the pending transaction carrying the resource scheduling information into the shared data structure; Accordingly, the resource coordination module is further configured to obtain the pending transaction carrying the resource scheduling information by detecting the shared data structure; Determine the at least two thread modules associated with the pending transaction according to the resource scheduling information; When it is determined that the pending transaction is in a pending execution state, the transaction processing request is sent to each thread module.

3. According to the system of claim 1, the resource coordination module is further configured to determine resource preparation information for each thread module respectively, create an interrupt request carrying the resource preparation information as the transaction processing request, and send it to each thread module.

4. According to the system of claim 3, each thread module is further configured to receive the interrupt request carrying the resource preparation information, and call an interrupt processing function according to the interrupt request; process the resource preparation information through the interrupt processing function, and determine the thread status information according to the information processing result.

5. The system according to any one of claims 1 to 3, wherein each thread module is further configured to write the thread state information into an information sharing unit; Correspondingly, the resource coordination module is further configured to determine the thread status information corresponding to each thread module by polling the information sharing unit; determine the transaction processing information corresponding to the to-be-processed transaction according to the thread status information corresponding to each thread module, and write the transaction processing information into the information sharing unit; Correspondingly, each thread module is further configured to determine the transaction processing information by polling the information sharing unit, and process the pending transaction based on the transaction processing information.

6. The system according to claim 5, wherein the resource coordination module is further configured to, when determining that the at least two thread modules are in an available state according to the thread state information corresponding to each thread module, create transaction execution information as the transaction processing information according to the available state, and write the transaction processing information into the information sharing unit; Correspondingly, each thread module is further configured to determine the transaction execution information by polling the information sharing unit, determine the target resource according to the transaction execution information, and write the target resource into the resource scheduling queue; when the target resource meets the transaction processing condition of the resource scheduling queue, the pending transaction is processed through the target resource.

7. The system according to claim 5, wherein the resource coordination module is further configured to, when determining that at least one thread module is in a non-use state according to thread state information corresponding to each thread module, create transaction interruption information as the transaction processing information according to the non-use state, and write the transaction processing information into the information sharing unit; Correspondingly, each thread module is further configured to determine the transaction interruption information by polling the information sharing unit, determine at least two target thread modules according to the transaction interruption information, and send the to-be-processed transaction to the at least two target thread modules.

8. The system according to claim 2, wherein the resource coordination module is further configured to select a transaction thread module associated with the to-be-processed transaction according to the resource scheduling information, and determine the physical resource to which the transaction thread module belongs; Selecting at least one associated thread module associated with the transaction thread module in the physical resource; The at least two thread modules associated with the to-be-processed transaction are formed based on the transaction thread module and the at least one associated thread module.

9. A resource processing method, applied to a resource coordination module, comprising: Obtaining pending transactions by detecting a shared data structure, wherein the resource coordination module is a CPU with hyperthreading enabled; Determine at least two thread modules associated with the to-be-processed transaction, and send a transaction processing request to each thread module; Receiving thread status information fed back by each thread module in response to the transaction processing request, wherein the thread status information refers to status information of whether each thread module can process the pending transaction at the current moment, and each thread module is a hyperthread running a virtual machine; Based on the thread status information, transaction processing information corresponding to the pending transaction is determined, and the transaction processing information is sent to each thread module, wherein the transaction processing information means that when the thread status information corresponding to each thread module is in a state where the pending transaction can be executed, it is determined that resources need to be scheduled to process the pending transaction.

10. The method according to claim 9, wherein receiving thread status information fed back by each thread module in response to the transaction processing request comprises: Determine the thread status information fed back by each thread module in response to the transaction processing request by polling the information sharing unit; Accordingly, determining the transaction processing information corresponding to the to-be-processed transaction based on the thread state information, and sending the transaction processing information to each thread module includes: When it is determined according to the thread status information corresponding to each thread module that the at least two thread modules are in an available state, creating transaction execution information according to the available state as the transaction processing information; Alternatively, when it is determined according to the thread status information corresponding to each thread module that at least one thread module is in a non-use state, transaction interruption information is created according to the non-use state as the transaction processing information.

11. A resource processing method, applied to a thread module, comprising: Receiving a transaction processing request sent by a resource coordination module for a pending transaction, wherein the resource coordination module is a CPU with hyperthreading enabled; Determine thread status information according to the transaction processing request, and feed back the thread status information to the resource coordination module, wherein the thread status information refers to status information of whether each thread module can process the pending transaction at the current moment, and each thread module is a hyperthread running a virtual machine; Receiving transaction processing information fed back by the resource coordination module in response to the thread state information, wherein the transaction processing information refers to determining that resources need to be scheduled to process the pending transaction when the thread state information corresponding to each thread module is in a state where the pending transaction can be executed; The pending transaction is processed based on the transaction processing information.

12. The method according to claim 11, wherein feeding back the thread status information to the resource coordination module comprises: Writing the thread status information into the information sharing unit as feedback corresponding to the resource coordination module; Correspondingly, the receiving of the transaction processing information fed back by the resource coordination module with respect to the thread state information includes: The transaction processing information fed back by the resource coordination module with respect to the thread status information is determined by polling the information sharing unit.

13. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method according to any one of claims 9 to 12 are implemented.

Citation Information

Patent Citations

  • Database data synchronization method and device and storage medium

    CN112988883A

  • Safe hyper-threading for virtual machines

    US20200334062A1