A method and device for querying execution of a task, a storage medium and an electronic device

By parsing query requests and matching resource groups, the problem of merchant resource consumption was solved, enabling merchants to execute tasks under appropriate resource conditions, thus improving system stability and scalability.

CN116048794BActive Publication Date: 2026-01-09BEIJING OCEANBASE TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211741115.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-01-09
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

During the execution of query tasks, the mutual influence between different merchants in occupying resources causes some merchants to be unable to perform their business normally. Especially when the data traffic is large, the competition for resources by top merchants affects the service quality of long-tail merchants.

Method used

By parsing the query request, the object identifier of the target object and its corresponding resource group are determined. It is then determined whether the current resource group matches the target resource group. If they do not match, the resource group is adjusted to execute the query task, ensuring that the merchant executes the task under appropriate resource constraints.

Benefits of technology

This effectively avoids the mutual interference of resources between different merchants, ensures that all merchants can execute query tasks normally, reduces the difficulty of operation and maintenance, and simplifies the database expansion process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116048794B_ABST
    Figure CN116048794B_ABST
Patent Text Reader

Abstract

The specification discloses a query task execution method and device, a storage medium and an electronic device. The query task execution method comprises: acquiring a query request, the query request being used to query business data corresponding to a target object; analyzing the query request to determine an object identifier corresponding to the target object; querying a resource group corresponding to the object identifier as a target resource group; determining a resource group allocated for executing a query task corresponding to the query request as a current resource group; and judging whether the current resource group matches the target resource group. If yes, the query task corresponding to the query request is executed according to resources corresponding to the current resource group. Otherwise, the query task corresponding to the query request is executed according to resources corresponding to the target resource group.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a method, apparatus, storage medium, and electronic device for executing a query task. Background Technology

[0002] With the development of technology, resource isolation technology has become an important research direction for database systems. By setting up different resource groups, resource isolation technology can finely control and allocate system resources such as the central processing unit (CPU) and memory that different services can occupy, thereby avoiding some services from occupying too many system resources during actual business execution and affecting the normal operation of other services.

[0003] However, current resource isolation methods primarily divide resources into groups based on different business functions, allocating corresponding resource groups to different businesses. For any given business, all merchants providing that business or the client sending the request will use the resource group under that business to execute the query task. However, when data traffic is high, merchants with higher data access volumes often preempt resources from merchants with lower data access volumes, thus preventing the merchants with lower access volumes from executing their business normally.

[0004] Therefore, how to avoid the mutual interference between the resources occupied by different merchants during the execution of query tasks, and ensure that all merchants can execute query tasks normally, is an urgent problem to be solved. Summary of the Invention

[0005] This specification provides a method, apparatus, storage medium, and electronic device for executing query tasks. This is to avoid mutual interference between resources used by different merchants during the execution of query tasks, ensuring that all merchants can execute query tasks normally.

[0006] The following technical solution is adopted in this specification:

[0007] This manual provides a method for executing a query task, including:

[0008] Obtain a query request, which is used to query business data corresponding to the target object;

[0009] The query request is parsed to determine the object identifier corresponding to the target object;

[0010] Query the resource group corresponding to the object identifier and use it as the target resource group;

[0011] determine a resource group currently allocated for executing a query task corresponding to the query request as a current resource group, and determine whether the current resource group matches the target resource group;

[0012] If yes, execute the query task corresponding to the query request according to resources corresponding to the current resource group, otherwise, execute the query task corresponding to the query request according to resources corresponding to the target resource group.

[0013] Optionally, the method further comprises:

[0014] If it is monitored that object identifiers corresponding to at least part of the objects change, and / or resource groups corresponding to at least part of the objects change, update each object identifier corresponding to the at least part of the objects and the resource group corresponding to the each object identifier.

[0015] Optionally, the method further comprises:

[0016] If the target resource group corresponding to the object identifier is not queried out, determine a service based on which the query request is sent;

[0017] Determine a resource group pre-allocated for the service as a backup resource group;

[0018] Execute the query task corresponding to the query request according to resources of the backup resource group.

[0019] Optionally, executing the query task corresponding to the query request according to resources corresponding to the target resource group specifically comprises:

[0020] If the current resource group does not match the target resource group, return the query request to a query queue;

[0021] Change the current resource group to the target resource group, and reacquire the query request from the query queue;

[0022] Execute the query task corresponding to the query request according to resources corresponding to the target resource group.

[0023] The specification provides an execution device of a query task, comprising:

[0024] An acquisition module acquires a query request, the query request being used for querying service data corresponding to a target object;

[0025] An analysis module analyzes the query request to determine an object identifier corresponding to the target object;

[0026] A query module queries a resource group corresponding to the object identifier as a target resource group;

[0027] determining a resource group currently allocated for executing a query task corresponding to the query request as a current resource group, and judging whether the current resource group matches the target resource group;

[0028] performing the query task corresponding to the query request according to resources corresponding to the target resource group, if not.

[0029] Optionally, the query module is further configured to update each object identifier corresponding to at least part of the objects and a resource group corresponding to the each object identifier, if a change in the object identifier corresponding to at least part of the objects and / or a change in the resource group corresponding to at least part of the objects is monitored.

[0030] Optionally, the execution module is further configured to determine a service based on which the query request is sent, if the target resource group corresponding to the object identifier is not queried out; determine a resource group pre-allocated for the service as a backup resource group; and perform the query task corresponding to the query request according to resources of the backup resource group.

[0031] Optionally, the execution module is specifically configured to return the query request to a query queue if the current resource group does not match the target resource group; change the current resource group to the target resource group, and reacquire the query request from the query queue; and perform the query task corresponding to the query request according to resources corresponding to the target resource group.

[0032] The specification provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the execution method of the query task.

[0033] The specification provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the execution method of the query task when executing the program.

[0034] The above at least one technical solution adopted by the specification can achieve the following beneficial effects:

[0035] In the query task execution method provided in the specification, the server obtains a query request, the query request being used to query business data corresponding to a target object, the query request being parsed to determine an object identifier corresponding to the target object, a resource group corresponding to the object identifier being queried as a target resource group, a resource group currently allocated for executing a query task corresponding to the query request being determined as a current resource group, and it being judged whether the current resource group matches the target resource group, if yes, the query task corresponding to the query request being executed according to resources corresponding to the current resource group, and if not, the query task corresponding to the query request being executed according to resources corresponding to the target resource group.

[0036] As can be seen from the above method, after obtaining a query request, the method can parse the query request to determine an object identifier of a target object, and further determine a resource group corresponding to the object identifier. In this way, different merchants can execute query tasks under the resource constraints of different resource groups. Compared with the method of dividing resource groups according to business, the method can effectively avoid mutual influence between resources occupied by different merchants when executing query tasks. Even if there are many query requests, large merchants will not cause small merchants to be unable to normally execute business due to occupying too many resources. BRIEF DESCRIPTION OF DRAWINGS

[0037] The accompanying drawings, which are included to provide a further understanding of the specification, form a part of the specification and illustrate the illustrative embodiments of the specification and are used to explain the specification, and do not constitute an improper limitation on the specification. In the drawings:

[0038] Figure 1 A flowchart of a query task execution method provided in the specification;

[0039] Figure 2 A correspondence between an object identifier and a resource group provided in the specification;

[0040] Figure 3 A data query flowchart when a current resource group hits a target resource group provided in the specification;

[0041] Figure 4 A data query flowchart when a current resource group does not hit a target resource group provided in the specification;

[0042] Figure 5 A schematic diagram of a query task execution device provided in the specification;

[0043] Figure 6 A schematic diagram of an electronic device corresponding to Figure 1 the specification. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0045] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0046] Figure 1 This is a flowchart illustrating a method for executing a query task provided in this specification, including the following steps:

[0047] S100: Obtain a query request, which is used to query the business data corresponding to the target object.

[0048] With the development of internet technology and the maturity of application software, Software-as-a-Service (SaaS) technology has been widely adopted, enabling SaaS platform providers to offer software services to users via the internet. Currently, a SaaS platform (such as a shopping platform or e-commerce platform) typically hosts a large number of merchants, who are usually divided into top-tier merchants and long-tail merchants. The top 20% of merchants account for approximately 80% of the traffic, while the remaining 80% of long-tail merchants account for about 20% of the traffic.

[0049] In practical applications, since top merchants have a large demand for traffic, the SaaS platform needs to allocate more resources to top merchants and less resources to long-tail merchants. In order to avoid top merchants exhausting computing resources and thus affecting the service quality of the other 80% of long-tail merchants, or even causing these long-tail merchants to be unable to perform their business normally.

[0050] Based on this, this specification provides a method for executing a query task, wherein the server needs to obtain a query request, which is used to query business data (such as inventory, efficiency, and product amount) corresponding to the target object. The query request can be a data query request sent by a merchant registered on the above-mentioned SaaS platform, or it can be a data query request sent by a user through the client of the business platform.

[0051] The target object can be a merchant registered in a service platform provided by the server, or a user registered in the service platform. Therefore, the execution method of the query task can be used to execute a query task for the merchant by using the resource group allocated to the merchant. The query task for the merchant can be a query task initiated by the merchant to query its own service data, or a query task initiated by a user to query the service data of the merchant. When the target object is a user, the user can execute a data query task by using the resource group allocated to the user.

[0052] In this specification, the execution subject of the execution method of the query task can be the server of the SaaS platform. For ease of description, the execution method of the query task provided in this specification is described by taking the server as the execution subject.

[0053] In addition, in this specification, the data to be queried by different query requests can be stored in a data table of a database, which can be deployed in one server node or multiple server nodes, and the number of server nodes is not limited in this specification.

[0054] S102: Analyzing the query request to determine the object identifier corresponding to the target object.

[0055] S104: Querying the resource group corresponding to the object identifier as the target resource group.

[0056] Specifically, the server can preconfigure a data query rule in the database. The program statement corresponding to the query rule can be:

[0057]

[0058]

[0059] The program statement defines the attribute of each column of the query rule, the value (object identifier of the object), and the resource group (consumer_group) corresponding to each object identifier. For example, "test.t1.c1=4", where the object identifier (ID) is 4, and the resource group corresponding to the object identifier is a "big" resource group.

[0060] In this way, the server can determine the correspondence between each object identifier (ID) and different resource groups, as shown in Figure 2

[0061] Figure 2 ​A correspondence between an object identifier and a resource group provided in the present book.

[0062] In the present specification, the user resource group can be divided into a small resource group, a medium resource group, a big resource group, and a share resource group. For some small business flow, the corresponding ID of the object is attributed to "others", and the same share resource group can be allocated to these small businesses.

[0063] Of course, there are also some object identifiers corresponding to the same resource group, such as object identifier 3 and object identifier 4 corresponding to the big resource group.

[0064] In practical applications, the resource group can be a mechanism provided by the Linux kernel to limit the resources used by a single process or multiple processes, which can achieve fine control of hardware and software resources such as CPU, memory, network bandwidth, etc. For example, on an eight-core server that deploys both front-end web services and back-end computing modules, resource groups can be used to limit the front-end web services to use only six cores, leaving the remaining two cores for the back-end computing module. In other words, different resource groups define different resource quantities (CPU, memory, etc.), with the smallest resource quantity corresponding to the small resource group, the medium resource group, the big resource group, and the share resource group, which can be set according to actual conditions, and the present specification does not make specific limitations.

[0065] When the server obtains the query request sent by the user or the merchant, the query request can be parsed to determine the source of the query request, and then the object identifier of the target object corresponding to the query request is matched in the above query rule, and the resource group corresponding to the object identifier is taken as the target resource group.

[0066] Specifically, the server can first determine whether the database has a target predicate corresponding to the above matching rule, such as "t1.c1 =?". Wherein "? " is a constant, representing an object identifier. When the target predicate exists, the server can further determine whether the query rule defines the resource group corresponding to the object identifier, if yes, the server can take the resource group as the target resource group corresponding to the query request.

[0067] For some newly registered objects, the object may not have been allocated a corresponding resource group, so even if the object identifier of the object is parsed, the corresponding resource group cannot be determined.

[0068] In the present specification, the server can also determine the resource group by another method. For a service platform, there can be multiple different services under the service platform, such as food, medicine, tourism, etc. or different service interfaces, and these different services or different service interfaces correspond to different usernames in the database. The server can divide the resource groups corresponding to different services based on different services.

[0069] In order to prevent errors caused by the resource group corresponding to the service based on the current query request being inconsistent with the resource group corresponding to the object identifier, the server can set different priorities for the resource groups determined in different ways, and the resource group determined based on the service based on the current query request is used as a backup resource group, and the resource group determined based on the object identifier is used as a target resource group. In this way, the server will preferentially execute the query task according to the target resource group corresponding to the object identifier, and only when the target resource group is not determined, the query task will be executed according to the backup resource group.

[0070] In addition, in the actual application process, the server is likely to receive a large number of same query requests in a short time. Therefore, in order to improve the efficiency of the query task, when the server determines the object identifier of the target object and the target resource group, the object identifier and the target resource group corresponding to the query request can be stored in the local cache. In this way, when the server receives the next query request of the same object within a preset time, the corresponding object identifier and target resource group can be directly read from the local cache, and there is no need to reparse the target resource group in the query rules stored in the database. The above-mentioned preset time can be set according to the actual situation, and the present specification does not make specific limitations.

[0071] Further, in order to avoid the query rules stored in the database being changed or adjusted, resulting in the object identifier and the target resource group corresponding to the query request stored in the database being changed, the server can monitor the query rules at a preset time interval, and when it is monitored that at least part of the object identifiers are changed and / or at least part of the resource groups corresponding to the objects are changed, the object identifiers and the resource groups corresponding to the object identifiers of at least part of the objects are updated, so that the object identifiers and the corresponding resource groups stored in the local cache are synchronized with the query rules stored in the database.

[0072] S106: Determine the resource group currently allocated for executing the query task corresponding to the query request as the current resource group, and determine whether the current resource group matches the target resource group.

[0073] S108: If yes, performing the query task corresponding to the query request according to the resource corresponding to the current resource group, otherwise, performing the query task corresponding to the query request according to the resource corresponding to the target resource group.

[0074] When the server receives the query request, a session is established between the query request and the database as a connection between the query request and the database. In the process of data query, the server can add a resource group variable to the connection, which represents the resource group currently allocated for executing the query task corresponding to the query request as the target resource group.

[0075] In the present specification, when the server determines the target resource group corresponding to the current query request and executes the data query task under the resource constraint of the target resource group, the target resource group can not be changed, that is, when the server receives the query request, the target resource group corresponding to the previous query request is defaulted as the current resource group corresponding to the current query request, so that the resource group variable corresponding to the current session connection remains unchanged. In this way, when the target resource groups corresponding to the current query request and the previous query request are the same, the target resource group does not need to be changed, thereby improving the efficiency of data query.

[0076] When the current resource group does not match the target resource group, the server can adjust the current resource group.

[0077] Specifically, after receiving the query request, the server can first add the query request to the query queue. After determining the target resource group corresponding to the current query request, the server can first judge whether the current resource group (i.e. the resource group recorded by the above session connection) matches the target resource group. If it matches, it means that the current resource group is exactly the target resource group expected by the query rule, and at this time, the current resource group does not need to be adjusted, and the server can directly query the data corresponding to the query request in the database under the resource constraint provided by the target resource group, and send the data to the target object. In order to facilitate understanding, the present specification provides a data query flowchart when the current resource group hits the target resource group, as shown in Figure 3 .

[0078] Figure 3 A data query flowchart when the current resource group hits the target resource group is provided in the present specification.

[0079] When the server receives the query request, the server can first add the query request to the query queue, and determine the object ID and the resource group corresponding to the query request. When the server determines that the current resource group (resource group 1) is consistent with the target resource group, the server can determine the data corresponding to the query request in the database under the resource constraint of the resource group 1, and return the target object.

[0080] If the current resource group (i.e., the resource group recorded by the session connection) does not match the target resource group, the server can return the query request to the query queue for retry.

[0081] In the retry process, the server can change the current resource group to the target resource group, change the resource group variable corresponding to the session connection to the resource group variable corresponding to the target resource group, and then continue to determine whether the resource group recorded by the current session connection is consistent with the target resource group determined according to the query rule. When the determination is consistent, the server can execute the query request in the query queue under the resource constraint provided by the target resource group, so as to query the data corresponding to the query request in the database, and send the data to the target object. In order to facilitate understanding, the present specification provides a data query flowchart when the current resource group does not hit the target resource group, as shown in Figure 4

[0082] Figure 4 The data query flowchart when the current resource group does not hit the target resource group is provided in the present specification.

[0083] When the server receives the query request, the server can first add the query request to the query queue, and determine the object ID and the resource group corresponding to the query request. When the server determines that the current resource group (resource group 1) is consistent with the target resource group, the server can determine the data corresponding to the query request in the database under the resource constraint of the resource group 1, and return the target object.

[0084] In addition, before determining whether the resource group currently allocated for the query request matches the target resource group, the server can first determine whether the target predicate corresponding to the query rule is stored in the database, i.e., whether there is a predicate (t1.c1 =?). If not, it indicates that the query rule is not stored in the database. At this time, the server can determine the business based on which the current query request is based, and execute the query task corresponding to the query request according to the resources of the standby resource group corresponding to the business.

[0085] ​If the server finds the target predicate corresponding to the query rule in the database, but does not find the object identifier in the target predicate or does not find the target resource group corresponding to the object identifier, it means that the resource group corresponding to the current object is not defined in the query rule. At this time, the server can determine the service based on which the query request is sent, and then determine the standby resource group pre-allocated for the service, and then execute the query task corresponding to the query request according to the resources of the standby resource group.

[0086] In actual application, there are often different query requests. Some query requests are sent by objects and the object identifiers of the corresponding objects can be determined, and some query requests are sent by users and are full-tag scanning query requests, which cannot obtain the object identifiers of the corresponding objects. Therefore, for the query request sent by the object containing the object identifier, the server can mark it, so as to mark the query request as the query request that has been defined by the query rule.

[0087] In this way, when the server receives the query request, if the query request carries the above-mentioned mark, the server can further determine the object identifier of the corresponding object and the target resource group, and then judge whether the current resource group matches the target resource group. If the query request received by the server does not carry the above-mentioned mark, it means that the query request is sent by the user, and at this time the server can directly obtain the standby resource group corresponding to the current service, and then execute the query task under the resources of the standby resource group.

[0088] In addition, when configuring the above-mentioned query rule, the server can predefine different resource groups and determine the resource constraints corresponding to different resource groups. When setting the above-mentioned query rule, the query rule can contain five parameters, including library name, table name, column name, value and user name. The library name and the user name are not necessary, the default library name is the current library name, and an error is reported when no library is used at present. When the user name is not specified, it is effective for all users, including newly created users. The other three parts are necessary and only one value can be specified. In addition, the server can specify that the table, column, user name and other parameters must exist when creating the above-mentioned query rule. After creating the rule, if the table and the user are deleted and then rebuilt, the matching rule is still applicable. In addition, the query rule created in the database can be set to take effect after a preset time, and the priority of the resource group determined by the query rule is higher than the priority of the resource group determined by the user name. In addition, when defining the query rule, the server can support numerical or string type constants.

[0089] As can be seen from the above method, after obtaining the query request, the query request can be parsed to determine the object identifier of the target object, and then the resource group corresponding to the object identifier is determined. In this way, different objects can execute query tasks under the resource constraints of different resource groups. Compared with the current method of dividing resource groups according to business, the present scheme can effectively avoid the mutual influence between the resources occupied by different merchants when executing query tasks. Even if there are many query requests, large merchants will not occupy too many resources, causing small merchants to be unable to normally execute business.

[0090] Moreover, the present scheme can realize resource isolation of different objects in the same database, reducing the difficulty of database operation and maintenance in the later stage and reducing the operation and maintenance cost.

[0091] In addition, the present scheme also solves the problem of database expansion trouble. By dividing the resource groups corresponding to different object identifiers, the expansion of the database can be easily realized, avoiding the situation that in the prior art, when large merchants and small merchants execute query tasks in the same database, the large merchants occupy more computing resources, causing the small merchants to be unable to normally provide services.

[0092] The above is the execution method of one or more embodiments of the present specification for query tasks. Based on the same idea, the present specification also provides a corresponding query task execution device, as shown in Figure 5 .

[0093] Figure 5 A schematic diagram of a query task execution device provided by the present specification includes:

[0094] The acquisition module 500 is configured to acquire a query request, and the query request is used to query business data corresponding to a target object.

[0095] The analysis module 502 is configured to analyze the query request to determine the object identifier corresponding to the target object.

[0096] The query module 504 is configured to query the resource group corresponding to the object identifier as a target resource group.

[0097] The determination module 506 is configured to determine the resource group allocated for executing the query task corresponding to the query request as a current resource group, and determine whether the current resource group matches the target resource group.

[0098] The execution module 508 is configured to execute the query task corresponding to the query request according to the resources corresponding to the current resource group if the current resource group matches the target resource group, otherwise, execute the query task corresponding to the query request according to the resources corresponding to the target resource group.

[0099] Optionally, the query module 504 is further configured to update each object identifier corresponding to the at least some objects and the resource group corresponding to each object identifier if it is detected that the object identifier corresponding to at least some objects has changed, and / or the resource group corresponding to at least some objects has changed.

[0100] Optionally, the execution module 508 is further configured to: if the target resource group corresponding to the object identifier is not found, determine the service on which the query request is based; determine a resource group pre-allocated to the service as a backup resource group; and execute the query task corresponding to the query request according to the resources of the backup resource group.

[0101] Optionally, the execution module 508 is specifically configured to: if the current resource group does not match the target resource group, return the query request to the query queue; change the current resource group to the target resource group and retrieve the query request again from the query queue; and execute the query task corresponding to the query request according to the resources corresponding to the target resource group.

[0102] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1 This provides a method for executing query tasks.

[0103] This instruction manual also provides Figure 6 The diagram shown is a schematic structural diagram of an electronic device corresponding to the figure. For example... Figure 6 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for the business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above-mentioned functions. Figure 1 The method for executing the query task is described above. Of course, besides software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution entity of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.

[0104] In the 1990s, it was quite obvious to distinguish whether an improvement in a technology was in hardware (e.g., improvement in circuit structures of diodes, transistors, switches, etc.) or in software (improvement in method flow). However, as technology has evolved, many improvements in method flow today can be considered as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structures by programming the improved method flow into hardware circuits. Therefore, it cannot be said that an improvement in a method flow cannot be implemented by hardware entity modules. For example, a programmable logic device (PLD) (e.g., a field programmable gate array (FPGA)) is an integrated circuit whose logic function is determined by user programming of the device. A digital system is "integrated" on a PLD by the designer programming it, rather than by asking a chip manufacturer to design and fabricate a custom integrated circuit chip. Moreover, instead of manually fabricating integrated circuit chips, this programming is now mostly implemented by "logic compiler" software, which is similar to software compilers used in program development, and the original code to be compiled is written in a specific programming language, which is called a hardware description language (HDL), and there are many such languages, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., and the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should be aware that, as long as the method flow is logically programmed in the above-mentioned hardware description languages and programmed into an integrated circuit, a hardware circuit implementing the logical method flow can be easily obtained.

[0105] The controller can be implemented in any suitable way, e.g. the controller can take the form of a microprocessor or processor and a computer readable medium storing computer readable program code, e.g. software or firmware, executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller and an embedded microcontroller, examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91 SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to being implemented in pure computer readable program code form, the controller can perfectly well be implemented by means of logic programmed into logic gates, switches, application specific integrated circuits, programmable logic controllers and embedded microcontrollers, etc. to perform the same functions. The controller can thus be considered as a hardware component, and the means comprised therein for performing various functions can be considered as structures within the hardware component. Alternatively, or even, the means for performing various functions can be considered as both a software module implementing a method and a structure within a hardware component.

[0106] The systems, apparatuses, modules or units illustrated by the above embodiments can be implemented by computer chips or entities, or products with certain functions. A typical implementation device is a computer. Specifically, the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0107] For the sake of description, the above apparatuses are described in various units by functions respectively. Of course, the functions of each unit can be implemented in one or more software and / or hardware in the implementation of the present specification.

[0108] Those skilled in the art will understand that the embodiments of the present specification can be provided as a method, a system or a computer program product. Therefore, the present specification can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.

[0109] The specification is presented with reference to flow diagrams and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing element 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, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Although the flow diagrams and / or block diagrams can present a method, apparatus or computer program product in a particular, it is understood that the method, apparatus and computer program product can include one or more additional steps, operations, or functions, and the method, apparatus and computer program product can include fewer than all of the steps, operations, or functions shown in the figures. Additionally, the steps, operations, or functions need not be implemented in the order shown in the figures. Further, the steps, operations, or functions can be implemented using additional or different steps, operations, or functions. Figure 1 These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flow diagrams and / or block diagrams block or blocks.

[0110] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Although the flow diagrams and / or block diagrams can present a method, apparatus or computer program product in a particular, it is understood that the method, apparatus and computer program product can include one or more additional steps, operations, or functions, and the method, apparatus and computer program product can include fewer than all of the steps, operations, or functions shown in the figures. Additionally, the steps, operations, or functions need not be implemented in the order shown in the figures. Further, the steps, operations, or functions can be implemented using additional or different steps, operations, or functions. Figure 1 These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flow diagrams and / or block diagrams block or blocks.

[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus or computer program product according to embodiments of the specification. Although the flow diagrams and / or block diagrams can present a method, apparatus or computer program product in a particular, it is understood that the method, apparatus and computer program product can include one or more additional steps, operations, or functions, and the method, apparatus and computer program product can include fewer than all of the steps, operations, or functions shown in the figures. Additionally, the steps, operations, or functions need not be implemented in the order shown in the figures. Further, the steps, operations, or functions can be implemented using additional or different steps, operations, or functions. ​ These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flow diagrams and / or block diagrams block or blocks.

[0112] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0113] The memory can include non-persistent memory and / or volatile memory, such as a random access memory (RAM) including a cache area for the temporary storage of data. A

[0114] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0115] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but also other elements not explicitly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0116] Those skilled in the art will appreciate that embodiments of the present specification can be provided as methods, systems or computer program products. Therefore, the present specification can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0117] The present specification can be described in the general context of computer-executable instructions, such as program modules, executed by computers. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.

[0118] The various embodiments described in this specification are described using a numbering of embodiments approach: these are each individually integrated contributions pertaining to different but related aspects of the description. Each of the various embodiments can stand on its own, and each can be combined with the subject matter of other embodiments to produce further embodiments. Where appropriate, therefore, the contents of the specification can be regarded as being incorporated by reference, including the description, drawings, claims, abstract and the like.

[0119] The above description is embodied in the form of embodiments only and is not intended to limit the present specification. The present specification can be variously changed and modified by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims

1. A method for executing a query task, comprising: obtaining a query request, the query request being used to query business data corresponding to a target object, the business data being stored in a data table of a database; parsing the query request to determine an object identifier corresponding to the target object; querying a resource group corresponding to the object identifier as a target resource group; determining a resource group currently allocated for executing a query task corresponding to the query request as a current resource group, and judging whether the current resource group matches the target resource group; if yes, executing the query task corresponding to the query request according to resources of the current resource group, otherwise, executing the query task corresponding to the query request according to resources of the target resource group; wherein executing the query task corresponding to the query request comprises adding a resource group variable in a connection between a database and a database management system, to determine data corresponding to the query request in the database under a constraint of resources of a resource group corresponding to the resource group variable, and return a target object; the resource group variable is used to represent the resource group currently allocated for executing the query task corresponding to the query request. 2.The method of claim 1, further comprising: if a change of an object identifier corresponding to at least part of the objects and / or a change of a resource group corresponding to at least part of the objects is monitored, updating each object identifier corresponding to the at least part of the objects and the resource group corresponding to the each object identifier. 3.The method of claim 1, further comprising: if the target resource group corresponding to the object identifier is not queried, determining a business based on which the query request is sent; determining a resource group pre-allocated for the business as a backup resource group; executing the query task corresponding to the query request according to resources of the backup resource group. 4.The method of claim 1, wherein executing the query task corresponding to the query request according to resources of the target resource group comprises: if the current resource group does not match the target resource group, returning the query request to a query queue; changing the current resource group to the target resource group, and re-obtaining the query request from the query queue; executing the query task corresponding to the query request according to resources of the target resource group. 5.An apparatus for executing a query task, comprising: an obtaining module, configured to obtain a query request, the query request being used to query business data corresponding to a target object, the business data being stored in a data table of a database; a parsing module, configured to parse the query request to determine an object identifier corresponding to the target object; a querying module, configured to query a resource group corresponding to the object identifier as a target resource group; a determining module, configured to determine a resource group currently allocated for executing a query task corresponding to the query request as a current resource group, and judge whether the current resource group matches the target resource group; The execution module executes the query task corresponding to the query request according to the resource corresponding to the target resource group if the current resource group does not match the target resource group; wherein the execution of the query task corresponding to the query request comprises: adding a resource group variable in the connection between the database, so as to determine the data corresponding to the query request in the database under the constraint of the resource of the resource group corresponding to the resource group variable, and return a target object; the resource group variable is used to represent the resource group allocated for the execution of the query task corresponding to the query request. 6.The apparatus of claim 5, wherein the query module is further configured to update the object identifier corresponding to at least part of the objects and the resource group corresponding to the object identifier if it is monitored that the object identifier corresponding to at least part of the objects changes and / or the resource group corresponding to at least part of the objects changes.

7. The apparatus of claim 5, wherein the execution module is further configured to determine a service on which the query request is sent if the object identifier does not correspond to a target resource group. determining the resource group allocated for the service in advance as a backup resource group; executing the query task corresponding to the query request according to the resource of the backup resource group. 8.The apparatus of claim 5, wherein the execution module is specifically configured to return the query request to a query queue if the current resource group does not match the target resource group; change the current resource group to the target resource group, and reacquire the query request from the query queue; and execute the query task corresponding to the query request according to the resource corresponding to the target resource group. 9.A computer readable storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to implement the method of any one of claims 1 to 4. 10.An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method of any one of claims 1 to 4 when executing the program.

Citation Information

Patent Citations

  • Resource isolation system, request processing method and request processing device

    CN113067803A