CN116302408A - Method, device and system for executing multi-tenant scheduling task and electronic equipment - Google Patents

Method, device and system for executing multi-tenant scheduling task and electronic equipment Download PDF

Info

Publication number
CN116302408A
CN116302408A CN202310166507.3A CN202310166507A CN116302408A CN 116302408 A CN116302408 A CN 116302408A CN 202310166507 A CN202310166507 A CN 202310166507A CN 116302408 A CN116302408 A CN 116302408A
Authority
CN
China
Prior art keywords
tenant
information
task
data source
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310166507.3A
Other languages
Chinese (zh)
Inventor
张智慧
宓志明
王强
韩向东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yuannian Technology Co ltd
Original Assignee
Beijing Yuannian Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yuannian Technology Co ltd filed Critical Beijing Yuannian Technology Co ltd
Priority to CN202310166507.3A priority Critical patent/CN116302408A/en
Publication of CN116302408A publication Critical patent/CN116302408A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method, a device, a system and electronic equipment for executing multi-tenant scheduling tasks. The method for dispatching task execution by multiple tenants comprises the following steps: under the condition of task triggering, a scheduling task is acquired; acquiring a tenant list, wherein the tenant list contains tenant information of all tenants; traversing the tenant information of each tenant in the tenant list, and writing the tenant information of each tenant into the thread variable of the current thread in sequence in the traversing process; and carrying out business logic processing based on tenant information corresponding to each tenant to obtain a processing result corresponding to the dispatching task. According to the method and the device, a set of business execution logic of dispatching tasks for solving a plurality of tenants can be realized, the use of dispatching task service resources is finally reduced, and the dilemma of a 1:1 corresponding relation between a single tenant and the dispatching task service resources is solved.

Description

Method, device and system for executing multi-tenant scheduling task and electronic equipment
Technical Field
The application belongs to the technical field of computers, and particularly relates to a method, a device, a system and electronic equipment for executing a multi-tenant scheduling task.
Background
Task scheduling refers to the process of a system to execute a task at a specific moment in time in order to automatically complete a specific task.
In the prior art, in the Saas service context, each user performs data isolation according to the identity of the tenant, and in general, each tenant has related services, and performs specific data processing logic by means of timing task scheduling. In the process of executing the timing task, switching the data sources according to the information of the tenant, and storing the logic processing result in a database corresponding to the tenant. One tenant has a set of corresponding timing tasks, and the set of timing tasks is fixed on a database corresponding to the current tenant, then the task logic of the current tenant is processed and stored in the current database.
However, as the tenants increase, the total number of tasks of the corresponding tenant increases, and resources of the server are consumed in a large amount, so that efficient utilization of the resources is not achieved.
Therefore, how to improve the utilization rate of resources is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The embodiment of the application provides a method, a device, a system and electronic equipment for executing multi-tenant scheduling tasks, which can effectively improve the utilization rate of resources.
In a first aspect, an embodiment of the present application provides a method for performing multi-tenant task scheduling, where the method includes:
under the condition of task triggering, a scheduling task is acquired;
acquiring a tenant list, wherein the tenant list contains tenant information of all tenants;
traversing the tenant information of each tenant in the tenant list, and writing the tenant information of each tenant into the thread variable of the current thread in sequence in the traversing process;
and carrying out business logic processing based on tenant information corresponding to each tenant to obtain a processing result corresponding to the dispatching task.
Optionally, the tenant information includes data source information; traversing the tenant information of each tenant in the tenant list, and writing the tenant information of each tenant into the thread variable of the current thread in sequence in the traversing process, wherein the method comprises the following steps:
traversing the tenant information of each tenant in the tenant list, and writing the data source information of each tenant into the thread variable of the current thread in turn in the traversing process.
Optionally, the tenant information further includes identity information; traversing the tenant information of each tenant in the tenant list, and writing the tenant information of each tenant into the thread variable of the current thread in sequence in the traversing process, and further comprising:
traversing the tenant information of each tenant in the tenant list, and writing the identity information of each tenant into the context of the current thread in turn in the traversing process.
Optionally, performing service logic processing based on tenant information of each tenant to obtain a processing result corresponding to the scheduling task, where the processing result includes:
judging whether the data source information written in the thread variable of the current thread is used by a database or not;
under the condition that the data source information is used by the database, switching the corresponding data source information to the database based on the identity information in the context of the current thread, and carrying out business logic processing according to the data source information in the database to obtain a processing result corresponding to the scheduling task; or alternatively
And under the condition that the data source information is not used by the database, carrying out business logic processing based on the data source information in the current thread to obtain a processing result corresponding to the scheduling task.
Optionally, in the case that the data source information is used by the database, the method further includes: and writing the processing results corresponding to the dispatching tasks into a database and an execution log.
Optionally, in a case where the data source information is not used by the database, the method further includes: and writing the processing result corresponding to the scheduling task into an execution log.
Optionally, the data source information includes one or more of an internet protocol, a port, and access key information of the database.
In a second aspect, an embodiment of the present application provides an apparatus for performing multi-tenant task scheduling, where the apparatus includes:
the first acquisition module is used for acquiring a scheduling task under the condition of task triggering; the second acquisition module is used for acquiring a tenant list, wherein the tenant list contains tenant information of all tenants; the writing module is used for traversing the tenant information of each tenant in the tenant list and writing the tenant information of each tenant into the thread variable of the current thread in sequence in the traversing process; and the processing module is used for carrying out business logic processing based on the tenant information corresponding to each tenant to obtain a processing result corresponding to the dispatching task.
Optionally, the tenant information includes data source information; the writing module is used for traversing the tenant information of each tenant in the tenant list, and writing the data source information of each tenant into the thread variable of the current thread in sequence in the traversing process.
Optionally, the tenant information further includes identity information; the writing module is further used for traversing the tenant information of each tenant in the tenant list, and writing the identity information of each tenant into the context of the current thread in sequence in the traversing process.
Optionally, the processing module includes: the judging unit is used for judging whether the data source information written in the thread variable of the current thread is used by the database or not; the processing unit is used for switching the corresponding data source information to the database based on the identity information in the context of the current thread under the condition that the data source information is used by the database, and carrying out business logic processing according to the data source information in the database to obtain a processing result corresponding to the scheduling task; or under the condition that the data source information is not used by the database, carrying out business logic processing based on the data source information in the current thread to obtain a processing result corresponding to the scheduling task.
Optionally, the apparatus further comprises: and the first accounting module is used for writing the processing result corresponding to the scheduling task into the database and the execution log under the condition that the data source information is used by the database.
Optionally, the apparatus further comprises: and the second accounting module is used for writing the processing result corresponding to the scheduling task into the execution log under the condition that the data source information is not used by the database.
Optionally, the data source information includes one or more of an internet protocol, a port, and access key information of the database.
In a third aspect, an embodiment of the present application provides a dispatching system for executing a multi-tenant dispatching task, which includes a dispatching center, tenant task management, and the apparatus described above. The dispatching center is used for triggering the dispatching task and sending the dispatching task to the device; the tenant list is configured in the tenant task management; the device is used for acquiring the scheduling task and executing the scheduling task.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory storing computer program instructions; the processor, when executing the computer program instructions, implements a method of multi-tenant scheduling task execution as described above in the first aspect.
In a fifth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement a method of multi-tenant scheduling task execution as in the first aspect.
Under the condition of task triggering, the tenant task execution end firstly acquires dispatching task information, acquires a tenant list after acquiring the dispatching task information, traverses tenant information of all tenants in the tenant list in a traversing processing mode, sequentially writes the tenant information of each tenant into thread variables of a current thread in the traversing process, and finally carries out service logic processing based on the tenant information corresponding to each tenant, thereby realizing task switching among multiple tenants through the same tenant task execution end, enabling the multiple tenants to respectively carry out service logic processing corresponding to the dispatching tasks, and further greatly improving the utilization rate of resources.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described below, it will be obvious that the drawings in the description below are some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow diagram of a method for multi-tenant task execution according to one embodiment of the present application;
FIG. 2 is a schematic diagram of a method for multi-tenant task execution according to one embodiment of the present application;
FIG. 3 is a schematic structural diagram of an apparatus for performing multi-tenant scheduling tasks according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a system for multi-tenant task execution according to one embodiment of the present application; and
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present application are described in detail below to make the objects, technical solutions and advantages of the present application more apparent, and to further describe the present application in conjunction with the accompanying drawings and the detailed embodiments. It should be understood that the specific embodiments described herein are intended to be illustrative of the application and are not intended to be limiting. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by showing examples of the present application.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
Based on the background technology, as the tenants increase, the total number of tasks of the corresponding tenants also increases, and a large amount of resources of the server are consumed, so that efficient utilization of the resources is not realized.
In order to solve the problems in the prior art, the embodiment of the application provides a method, a device, a system and electronic equipment for executing multi-tenant scheduling tasks. The method for executing the multi-tenant scheduling task provided by the embodiment of the invention can be executed by the device for executing the multi-tenant scheduling task provided by the embodiment of the invention, and the device can be configured in the electronic equipment.
The following first describes a method for executing a multi-tenant scheduling task provided by an embodiment of the present application. Fig. 1 is a flow chart illustrating a method for performing multi-tenant task scheduling according to an embodiment of the present application.
As shown in fig. 1, the method for executing the multi-tenant scheduling task in the present application at least includes step S11, step S13, step S15, and step S17.
Step S11, under the condition of task triggering, a scheduling task is acquired.
In this application, the scheduling center is responsible for triggering the corresponding scheduling task according to the time required to be executed by the task, and sending the scheduling task information to a device (i.e. a tenant task executing end) for executing the multi-tenant scheduling task in an http request manner, so that the tenant task executing end obtains the scheduling task information and then executes the scheduling task.
Step S13, acquiring a tenant list, wherein the tenant list contains tenant information of all tenants. Specifically, the number of tenants in the tenant list may be 1 or multiple tenants.
Step S15, traversing the tenant information of each tenant in the tenant list, and writing the tenant information of each tenant into the thread variable of the current thread in turn in the traversing process.
Step S17, service logic processing corresponding to the dispatching task is carried out based on tenant information corresponding to each tenant, and therefore a processing result corresponding to the dispatching task is obtained.
It should be noted that, when the tenant task execution end completes execution of the scheduling task according to step S11, step S13, step S15 and step S17, the corresponding processing result information is returned to the scheduling center, so that the execution of the whole scheduling task is completed.
Therefore, in this embodiment, under the condition of task triggering, the tenant task execution end first acquires the scheduling task information, acquires the tenant list after acquiring the scheduling task information, then traverses the tenant information of all tenants in the tenant list in a traversing processing manner, sequentially writes the tenant information of each tenant into the thread variable of the current thread in the traversing process, and finally performs service logic processing based on the tenant information corresponding to each tenant, thereby realizing task switching between multiple tenants through the same tenant task execution end, so that the multiple tenants can respectively perform service logic processing corresponding to the scheduling task, and further greatly improving the utilization rate of resources.
In an optional embodiment, the tenant information includes data source information, and in step S15, traversing the tenant information of each tenant in the tenant list, and writing the tenant information of each tenant into the thread variable of the current thread in turn during the traversing process includes: traversing the tenant information of each tenant in the tenant list, and writing the data source information of each tenant into the thread variable of the current thread in turn in the traversing process.
In this embodiment, the Data Source (Data Source) is the device or original media that provides some desired Data. All information for establishing a database connection is stored in the data source. The data sources corresponding to each tenant are different. The tenant task execution end traverses all tenants in the tenant list, and when traversing the tenants in the tenant list, the tenant execution end sequentially writes the data source information of each tenant into the thread variable of the current thread, so that the tenant task execution end can perform business logic processing corresponding to the dispatching task based on the data source information, and a processing result corresponding to the dispatching task is obtained.
For example, such as: the tenant list includes A, B and C three tenants. Firstly, acquiring data source information of an A tenant, writing the data source information of the A tenant into a thread variable of a current thread, and then carrying out business logic processing corresponding to a scheduling task based on the data source information of the A tenant; after the data source information of the tenant A is processed, acquiring the data source information of the tenant B, writing the data source information of the tenant B into a thread variable of a current thread, and then carrying out business logic processing corresponding to a dispatching task based on the data source information of the tenant B; and after the data source information of the tenant B is processed, acquiring the data source information of the tenant C and carrying out service logic processing. And so on, if the tenant list comprises more tenants, the above manner can be adopted to process sequentially.
In this embodiment, for the scheduled task, the tenant task execution end implements task switching between multiple tenants based on the data source information corresponding to each tenant, so that the multiple tenants can respectively perform service logic processing corresponding to the scheduled task, thereby greatly improving the utilization rate of resources.
It should be noted that, the order of acquiring the data source information of the tenants in the tenant list may be an irregular acquisition order.
Alternatively, the data source information may include one or more of an internet protocol, a port, and access key information of the database.
In an optional embodiment, after the tenant information of the tenant is obtained by the tenant task execution end, the tenant information corresponding to the tenant may be cached in the cache server, so that the tenant information may be obtained by directly taking the tenant information from the cache server without obtaining the tenant information already cached in the server from the tenant list when the next task is executed.
In an optional embodiment, after the tenant information is cached in the cache server, the method and the device can detect the tenant information cached in the cache server in real time, so as to ensure that the tenant information cached in the cache server is the latest data. If the detected tenant information is not the latest data, the tenant task execution end still needs to acquire the latest tenant information of the corresponding user from the tenant list.
Alternatively, the cache server may be a NoSql cache database.
In an alternative embodiment, the tenant information includes data source information and identity information. In step S15, traversing the tenant information of each tenant in the tenant list, and writing the tenant information of each tenant into the thread variable of the current thread in turn during the traversing process, including: traversing the tenant information of each tenant in the tenant list, and writing the data source information of each tenant into the thread variable of the current thread in sequence in the traversing process; traversing the tenant information of each tenant in the tenant list, and writing the identity information of each tenant into the context of the current thread in turn in the traversing process. Therefore, the tenant task execution end can perform business logic processing corresponding to the dispatching task based on the data source information and the identity information, and accordingly a processing result corresponding to the dispatching task is obtained.
It should be noted that, the identity information and the data source information belong to the same tenant, that is, when the tenant task execution end traverses the tenant list, the identity information of the same tenant is written into the context of the thread, and the data source information is written into the thread variable of the thread, so as to ensure the integrity of the data when the tenant performs service processing. Meanwhile, business logic processing corresponding to the dispatching task is performed based on the data source information and the identity information, so that the method for executing the multi-tenant dispatching task can be still applicable under the condition that the data source information is used by a database, and the application scene of the method for executing the multi-tenant dispatching task is expanded. The case where the data source information is used by the database and the case where the data source information is not used by the database will be separately described below, and will not be described here.
Optionally, the identity information may be identity card information of the tenant, or may be other information capable of verifying identity of the tenant.
In an optional embodiment, in step S17, performing service logic processing based on tenant information corresponding to each tenant to obtain a processing result corresponding to the scheduling task may include: judging whether the data source information written in the thread variable of the current thread is used by a database or not; under the condition that the data source information is used by the database, switching the corresponding data source information to the database based on the identity information in the context of the current thread; and carrying out business logic processing according to the data source information in the database to obtain a processing result corresponding to the scheduling task.
Alternatively, in step S17, service logic processing is performed based on tenant information corresponding to each tenant, to obtain a processing result corresponding to the scheduling task, which may include: judging whether the data source information written in the thread variable of the current thread is used by a database or not; and under the condition that the data source information is not used by the database, carrying out business logic processing based on the data source information in the current thread to obtain a processing result corresponding to the scheduling task.
Referring to fig. 2, in the above embodiment, before performing service logic processing, the tenant task execution end determines whether the data source information is applied to the database, that is, whether the data source information is operated in the database. If the data source information is operated in the database, the tenant task execution end can switch the data source information corresponding to the tenant into the database according to the identity information in the context of the thread, so that the database carries out service logic processing on the data source information according to the code in the database, and the function of the data source information in the database is realized; and if the data source information is not used by the database, the tenant task execution end directly carries out business logic processing according to the data source information in the thread corresponding to the scheduling task issued by the scheduling center so as to obtain a processing result corresponding to the scheduling task. Therefore, based on the data source information and the identity information, the method for executing the multi-tenant scheduling task can be simultaneously applied to the situation that the data source information is used by the database and the situation that the data source information is not used by the database, and therefore the application scene of the method for executing the multi-tenant scheduling task is expanded.
In an alternative embodiment, the method further comprises: and writing the processing result corresponding to the scheduling task into the database and the execution log under the condition that the data source information is used by the database.
In this embodiment, as shown in fig. 2, in the case where the data source information is used by the database, the database performs service logic processing on the data source information according to the code therein, and writes the processing result corresponding to the scheduling task into the database and the execution log.
Alternatively, the processing result corresponding to the scheduling task may be written into the database first and then sent to the scheduling center, where the processing result is recorded in the execution log.
In an alternative embodiment, the method further comprises: and writing the processing result corresponding to the scheduling task into an execution log under the condition that the data source information is not used by the database.
In this embodiment, as shown in fig. 2, when the data source information is not used by the database, the tenant task execution end returns the corresponding processing result information to the dispatching center, and the dispatching center records the execution log, so that the execution of the whole dispatching task is completed.
Fig. 3 is a schematic structural diagram of an apparatus for performing multi-tenant scheduling task according to an embodiment of the present application. As shown in fig. 3, the apparatus includes: a first obtaining module 31, configured to obtain a scheduled task when the task triggers; a second obtaining module 32, configured to obtain a tenant list, where the tenant list includes tenant information of all tenants; the writing module 33 is configured to traverse the tenant information of each tenant in the tenant list, and sequentially write the tenant information of each tenant into the thread variable of the current thread in the traversing process; and the processing module 34 is configured to perform service logic processing based on tenant information corresponding to each tenant, so as to obtain a processing result corresponding to the scheduling task.
In this embodiment, based on the cooperation between the first acquiring module 31, the second acquiring module 32, the writing module 33 and the processing module 34, under the condition of task triggering, the task switching between multiple tenants can be realized by the device for executing the multi-tenant scheduling task, so that the multiple tenants can respectively execute the service logic processing corresponding to the scheduling task, and further the utilization rate of resources is greatly improved.
Optionally, the tenant information includes data source information. The writing module 33 is configured to traverse the tenant information of each tenant in the tenant list, and sequentially write the data source information of each tenant into the thread variable of the current thread in the traversing process.
Optionally, the tenant information further includes identity information. The writing module 33 is further configured to traverse tenant information of each tenant in the tenant list, and sequentially write identity information of each tenant into a context of a current thread in a traversing process.
Optionally, the processing module 34 includes a judging unit and a processing unit. The judging unit is used for judging whether the data source information written in the thread variable of the current thread is used by the database. And the processing unit is used for switching the corresponding data source information to the database based on the identity information in the context of the current thread under the condition that the data source information is used by the database, and carrying out business logic processing according to the data source information in the database to obtain a processing result corresponding to the scheduling task. Or the processing unit is used for carrying out business logic processing based on the data source information in the current thread under the condition that the data source information is not used by the database, so as to obtain a processing result corresponding to the scheduling task.
Optionally, the apparatus further comprises: and the first accounting module is used for writing the processing result corresponding to the scheduling task into the database and the execution log under the condition that the data source information is used by the database.
Optionally, the apparatus further comprises: and the second accounting module is used for writing the processing result corresponding to the scheduling task into the execution log under the condition that the data source information is not used by the database.
Optionally, the data source information includes one or more of an internet protocol, a port, and access key information of the database.
Each module/unit in the apparatus shown in fig. 3 has a function of implementing each step in fig. 1, and can achieve a corresponding technical effect, which is not described herein for brevity.
Fig. 4 is a schematic structural diagram of a scheduling system for performing multi-tenant scheduling tasks according to an embodiment of the present application. As shown in fig. 4, the dispatching system includes a dispatching center, a device for dispatching task execution by multiple tenants (i.e., a tenant task execution end), and tenant task management. The dispatching center can establish a communication relationship with the tenant task execution end, and is responsible for triggering a corresponding dispatching task and sending dispatching task information to the tenant task execution end according to the time required by the task to be executed. The tenant task execution end can establish a communication relationship with tenant task management (configured with a tenant list), and after acquiring a dispatching task sent by the dispatching center under the condition that the dispatching center triggers the task, the tenant task execution end acquires the tenant list from the tenant task management and performs task switching among multiple tenants based on tenant information of all tenants in the tenant list, so that the multiple tenants can respectively perform service logic processing corresponding to the dispatching task to complete the dispatching task.
Therefore, in the embodiment, the business logic processing among multiple tenants can be solved based on the same scheduling system, so that the utilization rate of resources is greatly improved.
Fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
The electronic device may comprise a processor 301 and a memory 302 storing computer program instructions.
In particular, the processor 301 may include a Central Processing Unit (CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured to implement one or more integrated circuits of embodiments of the present application.
Memory 302 may include mass storage for data or instructions. By way of example, and not limitation, memory 302 may comprise a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, magnetic tape, or universal serial bus (Universal Serial Bus, USB) Drive, or a combination of two or more of the foregoing. Memory 302 may include removable or non-removable (or fixed) media, where appropriate. The memory 302 may be internal or external to the electronic device, where appropriate. In particular embodiments, memory 302 may be a non-volatile solid state memory.
In one embodiment, memory 302 may be Read Only Memory (ROM). In one embodiment, the ROM may be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
Processor 301 implements the method of multi-tenant task execution in any of the above embodiments by reading and executing computer program instructions stored in memory 302.
In one example, the electronic device may also include a communication interface 303 and a bus 310. As shown in fig. 3, the processor 301, the memory 302, and the communication interface 303 are connected to each other by a bus 310 and perform communication with each other.
The communication interface 303 is mainly used to implement communication between each module, device, unit and/or apparatus in the embodiments of the present application.
Bus 310 includes hardware, software, or both, that couple components of the electronic device to one another. By way of example, and not limitation, the buses may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a micro channel architecture (MCa) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus, or a combination of two or more of the above. Bus 310 may include one or more buses, where appropriate. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
In addition, in combination with the method for performing multi-tenant task scheduling in the above embodiment, the embodiment of the application may be implemented by providing a computer readable storage medium. The computer readable storage medium has stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement a method of multi-tenant scheduling task execution in any of the above embodiments.
It should be clear that the present application is not limited to the particular arrangements and processes described above and illustrated in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps, after appreciating the spirit of the present application.
The functional blocks shown in the above-described structural block diagrams may be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transfer information. Examples of machine-readable media include electronic circuitry, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and the like. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be different from the order in the embodiments, or several steps may be performed simultaneously.
Aspects of the present application are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to being, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware which performs the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the foregoing, only the specific embodiments of the present application are described, and it will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to the corresponding processes in the foregoing method embodiments, which are not repeated herein. It should be understood that the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, which are intended to be included in the scope of the present application.

Claims (10)

1. A method of multi-tenant scheduling task execution, the method comprising:
under the condition of task triggering, a scheduling task is acquired;
acquiring a tenant list, wherein the tenant list contains tenant information of all tenants;
traversing the tenant information of each tenant in the tenant list, and writing the tenant information of each tenant into the thread variable of the current thread in sequence in the traversing process;
and carrying out business logic processing based on tenant information corresponding to each tenant to obtain a processing result corresponding to the dispatching task.
2. The method of multi-tenant task execution of claim 1,
the tenant information comprises data source information; the traversing the tenant information of each tenant in the tenant list, and writing the tenant information of each tenant into the thread variable of the current thread in turn in the traversing process, includes:
traversing the tenant information of each tenant in the tenant list, and writing the data source information of each tenant into the thread variable of the current thread in turn in the traversing process.
3. The method of multi-tenant task execution of claim 2,
the tenant information also comprises identity information; the traversing the tenant information of each tenant in the tenant list, and writing the tenant information of each tenant into the thread variable of the current thread in turn in the traversing process, further comprises:
traversing the tenant information of each tenant in the tenant list, and writing the identity information of each tenant into the context of the current thread in turn in the traversing process.
4. The method for executing the multi-tenant scheduling task according to claim 3, wherein performing business logic processing based on tenant information of each tenant to obtain a processing result corresponding to the scheduling task comprises:
judging whether the data source information written in the thread variable of the current thread is used by a database or not;
under the condition that the data source information is used by the database, switching the corresponding data source information to the database based on the identity information in the context of the current thread, and carrying out business logic processing according to the data source information in the database to obtain a processing result corresponding to the scheduling task; or alternatively
And under the condition that the data source information is not used by the database, carrying out business logic processing based on the data source information in the current thread to obtain a processing result corresponding to the scheduling task.
5. The method of multi-tenant task execution of claim 4, wherein in the event that the data source information is used by the database, the method further comprises: and writing the processing results corresponding to the dispatching tasks into a database and an execution log.
6. The method of multi-tenant task execution of claim 4, wherein in the event that the data source information is not used by the database, the method further comprises: and writing the processing result corresponding to the scheduling task into an execution log.
7. The method of multi-tenant task execution of any one of claims 1-6, wherein the data source information includes one or more of an internetworking protocol, a port, and access key information of a database.
8. An apparatus for multi-tenant scheduling task execution, the apparatus comprising:
the first acquisition module is used for acquiring a scheduling task under the condition of task triggering;
the second acquisition module is used for acquiring a tenant list, wherein the tenant list contains tenant information of all tenants;
the writing module is used for traversing the tenant information of each tenant in the tenant list and writing the tenant information of each tenant into the thread variable of the current thread in sequence in the traversing process;
and the processing module is used for carrying out business logic processing based on the tenant information corresponding to each tenant to obtain a processing result corresponding to the dispatching task.
9. A dispatching system for dispatching task execution by multiple tenants, characterized in that the dispatching system comprises a dispatching center, tenant task management and the device of claim 8;
the dispatching center is used for triggering the dispatching task and sending the dispatching task to the device;
the tenant list is configured in the tenant task management;
the device is used for acquiring the scheduling task and executing the scheduling task.
10. An electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;
the method of performing multi-tenant scheduling task execution as claimed in any one of claims 1-7 when the processor executes the computer program instructions.
CN202310166507.3A 2023-02-22 2023-02-22 Method, device and system for executing multi-tenant scheduling task and electronic equipment Pending CN116302408A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310166507.3A CN116302408A (en) 2023-02-22 2023-02-22 Method, device and system for executing multi-tenant scheduling task and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310166507.3A CN116302408A (en) 2023-02-22 2023-02-22 Method, device and system for executing multi-tenant scheduling task and electronic equipment

Publications (1)

Publication Number Publication Date
CN116302408A true CN116302408A (en) 2023-06-23

Family

ID=86837182

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310166507.3A Pending CN116302408A (en) 2023-02-22 2023-02-22 Method, device and system for executing multi-tenant scheduling task and electronic equipment

Country Status (1)

Country Link
CN (1) CN116302408A (en)

Similar Documents

Publication Publication Date Title
CN107729928B (en) Information acquisition method and device
CN109033772A (en) A kind of input method and device of verification information
US11210127B2 (en) Method and apparatus for processing request
US20210357251A1 (en) Electronic device and non-transitory storage medium implementing test path coordination method
CN116455694A (en) Baud rate setting method, baud rate setting device, baud rate setting equipment and storage medium
CN111324576B (en) Recording data storage method and device, storage medium and terminal equipment
CN112671878B (en) Block chain information subscription method, device, server and storage medium
CN116483584B (en) GPU task processing method and device, electronic equipment and storage medium
CN111143092B (en) Fault recording data processing method, system and terminal equipment
CN116302408A (en) Method, device and system for executing multi-tenant scheduling task and electronic equipment
US11409704B2 (en) Method, device and computer program product for managing storage system
CN111240923A (en) Automatic test method and device for recurring problems of vehicle navigation system and storage medium
CN111367948A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN109067864B (en) Notification message pushing method and device and electronic equipment
CN115858320A (en) Operation log recording method, apparatus, medium and product
CN114896641A (en) Data verification method and device, electronic equipment and computer readable storage medium
CN115134254A (en) Network simulation method, device, equipment and storage medium
CN114510305A (en) Model training method and device, storage medium and electronic equipment
CN114221883A (en) Message testing method, device, server and storage medium
CN110908886A (en) Data sending method and device, electronic equipment and storage medium
CN116594862B (en) DBMS test method and device, electronic equipment and readable storage medium
CN111787059B (en) Block tracking synchronization method and device, electronic equipment and computer storage medium
CN111917734B (en) Method and device for managing public key, electronic equipment and computer readable storage medium
CN108959019A (en) A kind of monitoring method of operating status, device and terminal
CN108519859B (en) Data reading method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination