CPU core binding method and device, equipment, medium and product

By receiving IPC requests on the kernel side and querying CPU information, and combining the binding information to decide on the target CPU, the binding inaccurate problem caused by changes in CPU status is solved, and the system call efficiency is improved.

CN118963998APending Publication Date: 2024-11-15HUNAN KAIHONG ZHIGU DIGITAL IND DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410956372.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In a multi-process operating system, when a user binds a CPU, the CPU state changes between two system calls, resulting in the bound CPU being unable to meet user expectations, reducing the system call efficiency.

Method used

By obtaining the kernel binding information in the cross-process communication IPC request of the service initiator, preset the IPC data packet, determine the target thread to be awakened, and obtain CPU information before waking the target thread, and determine the target matching the kernel binding information based on the CPU information. CPU ensures the accuracy of decisions and shortens the time interval between core binding operations and thread wake-up operations.

Benefits of technology

It improves the system scheduling efficiency and call efficiency, ensures the accuracy of CPU binding decisions, and optimizes the system scheduling method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963998A_ABST
    Figure CN118963998A_ABST
Patent Text Reader

Abstract

The invention discloses a CPU core binding method, device and equipment, a medium and a product. The method comprises the following steps: acquiring a cross-process communication IPC request of a service initiator, wherein the IPC request carries core binding information; determining a to-be-awakened target thread according to a preset IPC data packet and the core binding information; before the to-be-awakened target thread is awakened, CPU information is obtained; determining a target CPU matched with the core binding information; and binding the to-be-awakened target thread to the target CPU, and awakening the to-be-awakened target thread to execute the IPC request. An IPC request of a service initiator is received at a kernel side, CPU information is directly inquired in a kernel before a to-be-awakened target thread is awakened, and the kernel jointly decides and determines a target CPU according to CPU real-time information and kernel binding information. According to the method, the decision accuracy is ensured, the time interval between the core binding operation and the thread wakeup operation is shortened, the scheduling mode of the system is optimized, and the calling efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer processing technology, and in particular to a CPU core binding method, device, equipment, medium and product. Background Art

[0002] In a multi-process operating system, the operating system provides an interface that allows users to directly bind a thread or a process to a fixed CPU for execution. Sometimes, in order to run an operation at the highest efficiency, users will directly bind this operation to a CPU core. During inter-process communication (IPC), because the service initiator and the service executor are not in the same process, by specifying the core of the service execution process (thread), the scheduling efficiency can usually be optimized.

[0003] The user first obtains CPU information in user mode, and decides which CPU core should be bound based on CPU physical information such as system frequency.

[0004] However, during the time interval between two system calls, the CPU state has changed. At this time, the bound target CPU may no longer meet user expectations. In addition, the CPU physical state is not the only indicator that determines CPU scheduling. If this is the only indicator used for decision making, the selected CPU will be inaccurate, reducing the efficiency of system calls. Summary of the invention

[0005] The present invention provides a CPU core binding method, device, equipment, medium and product to achieve accurate determination of bound CPUs, thereby improving calling efficiency.

[0006] According to a first aspect of the present invention, a CPU core binding method is provided, comprising:

[0007] Obtaining the cross-process communication IPC request of the service initiator, wherein the IPC request includes core binding information;

[0008] Determine the target thread to be awakened according to the preset IPC data packet and the core binding information;

[0009] Before waking up the target thread to be awakened, obtaining CPU information;

[0010] Based on the CPU information, determine a target CPU that matches the core binding information;

[0011] The target thread to be awakened is bound to the target CPU, and the target thread to be awakened is awakened to execute the IPC request.

[0012] According to a second aspect of the present invention, there is provided a CPU core binding device, comprising:

[0013] A request acquisition module is used to acquire an IPC request for cross-process communication from a service initiator, wherein the IPC request includes core binding information.

[0014] A thread determination module, used to determine a target thread to be awakened according to a preset IPC data packet and the core binding information;

[0015] An information acquisition module, used for acquiring CPU information before waking up the target thread to be awakened;

[0016] A CPU determination module, used to determine a target CPU matching the core binding information based on the CPU information;

[0017] The CPU binding module is used to bind the target thread to be awakened to the target CPU, and wake up the target thread to be awakened to execute the IPC request.

[0018] According to a third aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0019] at least one processor; and

[0020] a memory communicatively connected to the at least one processor; wherein,

[0021] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the CPU core binding method described in any embodiment of the present invention.

[0022] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the CPU core binding method described in any embodiment of the present invention when executed.

[0023] According to a fifth aspect of the present invention, an embodiment of the present invention further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the CPU core binding method of any embodiment of the present invention is implemented.

[0024] The technical solution of the embodiment of the present invention is to obtain the cross-process communication IPC request of the service initiator, and the IPC request is accompanied by the core binding information; determine the target thread to be awakened according to the preset IPC data packet and the core binding information; obtain the CPU information before awakening the target thread to be awakened; determine the target CPU matching the core binding information based on the information of each CPU; bind the target thread to be awakened to the target CPU, and wake up the target thread to be awakened to execute the IPC request. By receiving the IPC request of the service initiator on the kernel side and directly querying the CPU information in the kernel before awakening the target thread to be awakened, the kernel jointly decides to determine the target CPU based on the real-time information of the CPU and the core binding information, the accuracy of the decision is guaranteed, the time interval between the core binding operation and the thread awakening operation time is shortened, the scheduling method of the system is optimized, and the calling efficiency is improved.

[0025] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 is a flowchart of a CPU core binding method provided according to Embodiment 1 of the present invention;

[0028] Figure 2 is a flow chart of a CPU core binding method provided according to Embodiment 2 of the present invention;

[0029] Figure 3 This is an example flow chart of a CPU core binding method provided according to Embodiment 2 of the present invention;

[0030] Figure 4 is a structural schematic diagram of a CPU core binding device provided according to Embodiment 3 of the present invention;

[0031] Figure 5 It is a schematic diagram of a structure for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] Embodiment 1

[0035] Figure 1 A flowchart of a CPU core binding method is provided for the first embodiment of the present invention. This embodiment is applicable to determining the binding CPU during IPC calls. The method can be executed by a CPU core binding device. The CPU core binding device can be implemented in the form of hardware and / or software. The CPU core binding device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0036] S110: Obtain an inter-process communication IPC request from the service initiator, wherein the IPC request includes core binding information.

[0037] In this embodiment, the service initiator can be understood as an object with cross-core services. The cross-process communication IPC request can be understood as a request for establishing data exchange and information transmission between different processes. Among them, the binding core information includes the CPU type, such as large core, medium core and small core, etc., which can be selected and set according to actual needs.

[0038] Specifically, before initiating an IPC operation, the service initiator first writes the core binding type in the data according to its own needs to form an IPC request with core binding information. The service initiator only needs to specify the core binding information and does not need to complete the subsequent core selection and binding operations.

[0039] S120: Determine the target thread to be awakened according to the preset IPC data packet and core binding information.

[0040] In this embodiment, the preset IPC data packet can be understood as all data information used to establish this IPC action. The target thread to be awakened can be understood as the thread that has not been awakened corresponding to the completed service.

[0041] Specifically, the processor may obtain a preset IPC data packet corresponding to the service initiator, add the current core binding information to the preset IPC data packet, and then initiate an IPC cross-process operation.

[0042] S130: Before waking up the target thread to be awakened, obtain CPU information.

[0043] In this embodiment, the CPU information may be understood as information of the CPU including information required in the core binding information, for example, the type of the CPU.

[0044] Specifically, before waking up the target thread to be awakened, the processor can detect through the IPC driver that the preset IPC data packet includes the core binding information, and can acquire the CPU information of all the included CPUs.

[0045] S140 . Determine a target CPU that matches the core binding information based on the information of each CPU.

[0046] In this embodiment, the target CPU may be understood as a CPU that matches the core binding information and has the highest execution efficiency.

[0047] Specifically, the processor can filter out CPUs of matching types from each CPU information based on the CPU type in the binding core information through the IPC driver, and then determine the current running state of each CPU from the CPUs of matching types to determine the target CPU with the highest execution efficiency corresponding to the running state.

[0048] S150: Bind the target thread to be awakened to the target CPU, and awaken the target thread to be awakened to execute the IPC request.

[0049] Specifically, the processor may bind the target thread to be awakened to the target CPU, and continue to execute the original code of the IPC communication to awaken the target thread to be awakened to execute the IPC request.

[0050] The technical solution of the embodiment of the present invention is to obtain the cross-process communication IPC request of the service initiator, and the IPC request is accompanied by the core binding information; determine the target thread to be awakened according to the preset IPC data packet and the core binding information; obtain the CPU information before awakening the target thread to be awakened; determine the target CPU matching the core binding information based on the information of each CPU; bind the target thread to be awakened to the target CPU, and wake up the target thread to be awakened to execute the IPC request. By receiving the IPC request of the service initiator on the kernel side and directly querying the CPU information in the kernel before awakening the target thread to be awakened, the kernel jointly decides to determine the target CPU based on the real-time information of the CPU and the core binding information, the accuracy of the decision is guaranteed, the time interval between the core binding operation and the thread awakening operation time is shortened, the scheduling method of the system is optimized, and the calling efficiency is improved.

[0051] Optionally, after binding the target thread to be awakened to the target CPU and awakening the target thread to be awakened to execute the IPC request, the method further includes:

[0052] Get the task execution result and make a callback of the task execution result.

[0053] In this embodiment, the task execution result can be understood as the result after execution by the target CPU.

[0054] Specifically, the processor can obtain the task execution result and call back the task execution result through the set callback function.

[0055] Embodiment 2

[0056] Figure 2 This is a flow chart of a CPU core binding method provided in Embodiment 2 of the present invention. This embodiment is a further refinement of the above embodiment. Figure 2 As shown, the method includes:

[0057] S210: Obtain an inter-process communication IPC request from the service initiator.

[0058] S220: Add the core binding information to the preset IPC data packet to form a target IPC data packet corresponding to the service initiator, and initiate an IPC cross-process operation.

[0059] In this embodiment, the target IPC data packet can be understood as the data packet of the service initiator performing this IPC action.

[0060] Specifically, the processor may add the core binding information to a preset IPC data packet to form a target IPC data packet corresponding to the service initiator, and initiate an IPC cross-process operation so that the corresponding IPC driver responds to the target IPC data packet.

[0061] S230: Determine the target process and the corresponding process descriptor according to the index information corresponding to the service initiator in the target IPC data packet.

[0062] In this embodiment, the index information can be understood as an index pointing to a process descriptor. The target process can be understood as an execution process of a program for implementing the service initiator's service and corresponding resources. The process descriptor can be understood as a data structure for describing the target process, which includes information related to the attributes of the process.

[0063] Specifically, the processor can determine the target process corresponding to the IPC request of the service initiator according to the index information corresponding to the service initiator in the target IPC data packet through the IPC driver, wherein the target process has been registered in the IPC driver when it is started, as well as the corresponding process descriptor.

[0064] S240: Based on the process descriptor, determine the target thread to be awakened from the target process.

[0065] Specifically, the processor may select a thread from the process as the target thread to be awakened based on the process descriptor through the IPC driver.

[0066] S250: Before waking up the target thread to be awakened, obtain CPU information.

[0067] Specifically, before waking up the target thread to be awakened, the processor can obtain CPU information. Since the prior art obtains CPU information in user mode, the core is bound based on the information at this time. However, the CPU state has changed during the time interval between two system calls. Before waking up the target thread to be awakened, the CPU information is obtained to shorten the time interval between obtaining the CPU information and the thread awakening operation to a minimum, thereby ensuring the correctness of subsequent decisions.

[0068] S260: Read the CPU type in the core binding information.

[0069] In this embodiment, the CPU type can be understood as the type of CPU that needs to be bound, such as a large core, a medium core, and a small core.

[0070] Specifically, the processor may read the CPU type included in the core binding information through the IPC driver.

[0071] S270 . Determine a candidate CPU that matches the CPU type according to the information of each CPU.

[0072] In this embodiment, the candidate CPU may be understood as a CPU that satisfies the CPU type.

[0073] Specifically, the processor may select candidate CPUs that match the CPU type from all CPUs according to the CPU information through the IPC driver, for example, select a CPU with a large core.

[0074] S280: Determine a target CPU based on each candidate CPU.

[0075] Specifically, the processor may analyze the current running status of the candidate CPUs through the IPC driver, and then determine the CPU with the highest efficiency in executing the IPC request as the target CPU.

[0076] Further, based on the above embodiment, the step of determining the target CPU according to each candidate CPU can be concretized as follows:

[0077] Each candidate CPU is parsed to determine the current running status information of the candidate CPU; and a target CPU that meets the efficiency condition is screened from the candidate CPUs according to the current running status information.

[0078] In this embodiment, the current running state information can be understood as information used to indicate the current running state of the candidate CPU, for example, it can include information such as usage rate, whether it is in an active state, whether it is in the same core as the caller, etc. The efficiency condition can be understood as a condition set for screening out the target CPU with the highest execution efficiency.

[0079] Specifically, the processor may parse each candidate CPU through an IPC driver to determine the current operating status information of each candidate CPU, and then select a target CPU that meets the efficiency condition through a set decision-making method.

[0080] S290: Bind the target thread to be awakened to the target CPU, and wake up the target thread to be awakened to execute the IPC request.

[0081] The technical solution of the embodiment of the present invention is that the service initiator specifies the core binding information according to the demand without completing the core binding operation, and forms an IPC request to be sent to the kernel. When the kernel recognizes the core binding demand, it will directly query the CPU information in the kernel before waking up the target thread to be awakened for the target service execution, which can reduce the number of system calls and shorten the time interval between obtaining the CPU information and the thread wake-up operation to a minimum, thereby ensuring the correctness of the decision. The kernel screens the CPU information based on the core binding information, determines the candidate CPU that meets the type condition, and then screens the target CPU that meets the efficiency condition through the current running status information of the candidate CPU. The kernel makes a joint decision based on the real-time current running status information of the CPU and user needs, which ensures the accuracy of the decision and can better optimize the scheduling method of the system, thereby optimizing the efficiency of this scheduling.

[0082] For the sake of illustrative purposes, a specific example is used to illustrate the present invention. Figure 3 This is an example flow chart of a CPU core binding method provided in Embodiment 2 of the present invention, such as Figure 3 As shown, the server kernel can be divided into three main bodies: the main process, the IPC driver, and the service that executes the bound core. The corresponding steps of the method are:

[0083] S31, receiving the IPC request from the service initiator through the main process, adding the core binding information to the preset IPC data packet to form a target IPC data packet, and initiating an IPC cross-process command;

[0084] S32, parsing the index information in the target IPC data packet through the IPC driver;

[0085] S33, find the target process and the corresponding process descriptor in the kernel;

[0086] S34, selecting a corresponding target thread to be awakened in the process descriptor;

[0087] S35, read the CPU type in the core binding information;

[0088] S36, according to the information of each CPU, filter out the candidate CPU that matches the CPU type, and according to the current running state information of the candidate CPU, determine the target CPU and bind the target thread to be awakened;

[0089] S37, waking up the target thread to be awakened;

[0090] S38, starting to execute the target business by executing the core-bound service;

[0091] S39, callback task execution result.

[0092] Embodiment 3

[0093] Figure 4 This is a schematic diagram of the structure of a CPU core binding device provided by Embodiment 3 of the present invention. Figure 4 As shown, the device includes: a request acquisition module 41, a thread determination module 42, an information acquisition module 43, a CPU determination module 44 and a CPU binding module 45.

[0094] The request acquisition module 41 is used to acquire the inter-process communication IPC request of the service initiator, wherein the IPC request is accompanied by the core binding information;

[0095] A thread determination module 42, configured to determine a target thread to be awakened according to a preset IPC data packet and the core binding information;

[0096] The information acquisition module 43 is used to acquire CPU information before waking up the target thread to be awakened;

[0097] A CPU determination module 44, configured to determine a target CPU matching the core binding information based on the CPU information;

[0098] The CPU binding module 45 is used to bind the target thread to be awakened to the target CPU, and wake up the target thread to be awakened to execute the IPC request.

[0099] The technical solution of the embodiment of the present invention is to obtain the cross-process communication IPC request of the service initiator, and the IPC request is accompanied by the core binding information; determine the target thread to be awakened according to the preset IPC data packet and the core binding information; obtain the CPU information before awakening the target thread to be awakened; determine the target CPU matching the core binding information based on the information of each CPU; bind the target thread to be awakened to the target CPU, and wake up the target thread to be awakened to execute the IPC request. By receiving the IPC request of the service initiator on the kernel side and directly querying the CPU information in the kernel before awakening the target thread to be awakened, the kernel jointly decides to determine the target CPU based on the real-time information of the CPU and the core binding information, the accuracy of the decision is guaranteed, the time interval between the core binding operation and the thread awakening operation time is shortened, the scheduling method of the system is optimized, and the calling efficiency is improved.

[0100] The core binding information includes the CPU type.

[0101] Furthermore, the thread determination module 42 is specifically used for:

[0102] Add the core binding information to a preset IPC data packet to form a target IPC data packet corresponding to the service initiator, and initiate an IPC cross-process operation;

[0103] Determine the target process and the corresponding process descriptor according to the index information corresponding to the service initiator in the target IPC data packet;

[0104] Based on the process descriptor, a target thread to be awakened is determined from the target process.

[0105] Further, the CPU determination module 44 includes:

[0106] A type reading unit, used to read the CPU type in the core binding information;

[0107] A first determining unit, configured to determine a candidate CPU matching the CPU type according to the CPU information;

[0108] The second determining unit is used to determine a target CPU according to each of the candidate CPUs.

[0109] The CPU core binding device provided in the embodiment of the present invention can execute the CPU core binding method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0110] The second determining unit is specifically used for:

[0111] Analyze each of the candidate CPUs to determine the current running status information of the candidate CPU;

[0112] According to each of the current running status information, a target CPU that meets the efficiency condition is screened from the candidate CPUs.

[0113] Optionally, the device also includes: a result callback module.

[0114] The result callback module is specifically used for: after binding the target thread to be awakened to the target CPU and awakening the target thread to be awakened to execute the IPC request, obtaining the task execution result and performing a callback of the task execution result.

[0115] Embodiment 4

[0116] Figure 5 A schematic diagram of the structure of an electronic device 50 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0117] like Figure 5As shown, the electronic device 50 includes at least one processor 51, and a memory connected to the at least one processor 51 in communication, such as a read-only memory (ROM) 52, a random access memory (RAM) 53, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 51 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 52 or the computer program loaded from the storage unit 58 to the random access memory (RAM) 53. In the RAM 53, various programs and data required for the operation of the electronic device 50 can also be stored. The processor 51, the ROM 52, and the RAM 53 are connected to each other via a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54.

[0118] A number of components in the electronic device 50 are connected to the I / O interface 55, including: an input unit 56, such as a keyboard, a mouse, etc.; an output unit 57, such as various types of displays, speakers, etc.; a storage unit 58, such as a disk, an optical disk, etc.; and a communication unit 59, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 59 allows the electronic device 50 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0119] The processor 51 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 51 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 51 performs the various methods and processes described above, such as the CPU core binding method.

[0120] In some embodiments, the CPU core binding method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 58. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 50 via the ROM 52 and / or the communication unit 59. When the computer program is loaded into the RAM 53 and executed by the processor 51, one or more steps of the CPU core binding method described above may be performed. Alternatively, in other embodiments, the processor 51 may be configured to execute the CPU core binding method in any other appropriate manner (e.g., by means of firmware).

[0121] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0122] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0123] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

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

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

[0126] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0127] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and the computer program implements the XCPU core binding method of any embodiment of the present invention when executed by a processor.

[0128] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0130] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A CPU core binding method, characterized in that: include: Obtaining the cross-process communication IPC request of the service initiator, wherein the IPC request includes core binding information; Determine the target thread to be awakened according to the preset IPC data packet and the core binding information; Before waking up the target thread to be awakened, obtaining CPU information; Based on the CPU information, determine a target CPU that matches the core binding information; The target thread to be awakened is bound to the target CPU, and the target thread to be awakened is awakened to execute the IPC request.

2. The method according to claim 1, characterized in that Determining the target thread to be awakened according to the target IPC data packet includes: Add the core binding information to a preset IPC data packet to form a target IPC data packet corresponding to the service initiator, and initiate an IPC cross-process operation; Determine the target process and the corresponding process descriptor according to the index information corresponding to the service initiator in the target IPC data packet; Based on the process descriptor, a target thread to be awakened is determined from the target process.

3. The method according to claim 1, characterized in that The determining, based on the CPU information, a target CPU that matches the core binding information includes: Read the CPU type in the core binding information; Determine, according to the CPU information, a candidate CPU that matches the CPU type; A target CPU is determined based on each of the candidate CPUs.

4. The method according to claim 3, characterized in that The step of determining a target CPU according to each of the candidate CPUs includes: Analyze each of the candidate CPUs to determine the current running status information of the candidate CPU; According to each of the current running status information, a target CPU that meets the efficiency condition is screened from the candidate CPUs.

5. The method according to claim 1, characterized in that The core binding information includes the CPU type.

6. The method according to claim 1, characterized in that After binding the target thread to be awakened to the target CPU and awakening the target thread to be awakened to execute the IPC request, the method further includes: Get the task execution result and call back the task execution result.

7. A CPU core binding device, characterized in that: include: A request acquisition module is used to acquire an inter-process communication IPC request from a service initiator, wherein the IPC request includes core binding information; A thread determination module, used to determine a target thread to be awakened according to a preset IPC data packet and the core binding information; An information acquisition module, used for acquiring CPU information before waking up the target thread to be awakened; A CPU determination module, used to determine a target CPU matching the core binding information based on the CPU information; The CPU binding module is used to bind the target thread to be awakened to the target CPU, and wake up the target thread to be awakened to execute the IPC request.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the CPU core binding method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the CPU core binding method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the CPU core binding method according to any one of claims 1 to 6.