Database compact sequence generation method and device, electronic equipment and storage medium

By determining the sequence range corresponding to the data sent by the operator in the database and combining it with the generated sequence, the problem of low database processing efficiency under large data volume is solved, and efficient sequence construction and database operation are achieved.

CN121636554APending Publication Date: 2026-03-10TIANJIN NANKAI UNIV GENERAL DATA TECH
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-02
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

When processing large amounts of data in a database, existing technologies cannot predict the amount of data on each node in advance, which requires each node to communicate with the central node to obtain a unique value, thus affecting the database's processing efficiency.

Method used

By determining the first data sent by the first operator based on the current operator, determining its corresponding sequence range, and combining it with the data to generate the first sequence, which is then sent to the superior operator, the complete construction of the sequence is achieved.

Benefits of technology

When dealing with large amounts of data, this method ensures database processing efficiency, reduces the need for communication with the central node, and improves database operation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121636554A_ABST
    Figure CN121636554A_ABST
Patent Text Reader

Abstract

The invention discloses a database compact sequence generation method and device, electronic equipment and a storage medium. The method comprises the steps of determining first data sent by a first operator based on a current operator; determining a sequence range corresponding to the first data; and combining the sequence range corresponding to the first data with the first data to obtain a first sequence, and sending the first sequence to the second operator. According to the technical scheme of the invention, the method comprises the steps: determining the first data sent by the first operator based on the current operator; determining a sequence range corresponding to the first data; the sequence range corresponding to the first data is combined with the first data to obtain the first sequence, the first sequence is sent to the second operator, the second operator is a superior operator of the current operator, complete construction of the sequence is achieved, and therefore the processing efficiency of a database is guaranteed under the condition that the data size is large.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology, and in particular to a method, apparatus, electronic device, and storage medium for generating compact database sequences. Background Technology

[0002] In database practice, there are often scenarios where it is necessary to assign consecutive sequence values ​​to the dataset to be processed.

[0003] Since the amount of data on each participating node cannot be predicted in advance, in order to ensure that the sequence in the result set of the operator is compact, each node needs to contact a central node to exclusively obtain a unique value when processing each valid data. Therefore, when the amount of data is large, it will seriously affect the processing efficiency of the database. Summary of the Invention

[0004] This invention provides a method, apparatus, electronic device, and storage medium for generating compact sequences in a database, in order to solve the problem of database processing efficiency being affected when the data volume is large.

[0005] According to one aspect of the present invention, a method for generating compact sequences in a database is provided, the method comprising:

[0006] Based on the current operator, determine the first data to be sent by the first operator; the first operator is a subordinate operator of the current operator; the first data is sequence data;

[0007] Determine the sequence range corresponding to the first data;

[0008] The first sequence is obtained by combining the sequence range corresponding to the first data with the first data.

[0009] The first sequence is sent to the second operator, which is the parent operator of the current operator.

[0010] According to another aspect of the present invention, a database compact sequence generation apparatus is provided, the apparatus comprising:

[0011] The first data determination module is used to determine the first data sent by the first operator based on the current operator; the first operator is a subordinate operator of the current operator; the first data is sequence data.

[0012] The sequence range determination module is used to determine the sequence range corresponding to the first data.

[0013] The first sequence generation module is used to combine the sequence range corresponding to the first data with the first data to obtain the first sequence;

[0014] The first sequence sending module is used to send the first sequence to the second operator, which is the parent operator of the current operator.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] At least one processor; and

[0017] A memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the database compact sequence generation method according to any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the database compact sequence generation method according to any embodiment of the present invention.

[0020] The technical solution of this invention involves determining the first data sent by the first operator based on the current operator; determining the sequence range corresponding to the first data; combining the sequence range corresponding to the first data with the first data to obtain a first sequence; and sending the first sequence to the second operator, which is the superior operator of the current operator, thereby achieving complete construction of the sequence and ensuring the processing efficiency of the database when the data volume is large.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of a database compact sequence generation method according to Embodiment 1 of the present invention;

[0024] Figure 2 This is a flowchart of another database compact sequence generation method provided in Embodiment 2 of the present invention;

[0025] Figure 3This is a schematic diagram of a database compact sequence generation device according to Embodiment 3 of the present invention;

[0026] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the database compact sequence generation method of this invention. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] Example 1

[0030] Figure 1 This is a flowchart of a database compact sequence generation method provided in Embodiment 1 of the present invention. This embodiment is applicable to the generation of database compact sequences. The method can be executed by a database compact sequence generation device, which can be implemented in hardware and / or software. This database compact sequence generation device can be configured in an electronic device with data processing capabilities. For example... Figure 1 As shown, the method includes:

[0031] S110. Based on the current operator, determine the first data to be sent by the first operator; the first operator is a subordinate operator of the current operator; the first data is sequence data.

[0032] In a distributed database, an operator is the smallest unit of computation that constitutes a query execution plan. The first operator can be a subordinate operator that requires the current operator.

[0033] The first operator sends the first data that needs to be constructed into a compact sequence to the current operator, which processes the first data and then transmits it to the next higher-level operator.

[0034] Since the current operator needs to process the first data sent by the first operator, the first data sent by the first operator will be stored in the cache space of the current operator after the first data is determined.

[0035] When the current operator receives the first data, it will continue to receive the first data until the local buffer is full or a specified number is reached.

[0036] S120. Determine the sequence range corresponding to the first data.

[0037] The data range of a sequence refers to the boundary of the values ​​that the data stored in the sequence can take.

[0038] After obtaining the first data, the sequence range corresponding to the first data can be deduced based on the completed sequence, thus obtaining the sequence range corresponding to the first data.

[0039] For example, when the first data is the initially constructed sequence, and the first digit of the sequence can be 0, if the first data contains 200 data points, then the sequence range corresponding to the first data is 0 to 199. If the first data is not the initially constructed sequence, then the sequence to be assigned is 800, and the first data contains 200 data points, then the sequence range corresponding to the first data is 800-999.

[0040] Optionally, determine the sequence range corresponding to the first data, including:

[0041] Determine the number of data points in the first set of data;

[0042] Determine the sequence number corresponding to the first data in the first data from the central node;

[0043] The sequence number corresponding to the first data in the first data sent by the receiving central node is determined, and the sequence range corresponding to the first data is determined based on the number of data in the first data and the sequence number corresponding to the first data in the first data.

[0044] To ensure the accuracy of the determination result when determining the sequence range of the first data, it is necessary to first determine the number of data in the first data and determine the sequence number corresponding to the first data in the first data from the central node. Starting from the sequence number corresponding to the first data in the first data, a sequence range that conforms to the number of data in the first data is constructed.

[0045] When determining the sequence range corresponding to the first data, the number of data points of the first data can be reduced by one for each sequence number determined, thereby ensuring the accuracy of the calculation results.

[0046] Optionally, determine the sequence range corresponding to the first data, including:

[0047] Determine the number of data points in the first set of data;

[0048] Construct an initial sequence range based on the number of data points in the first set of data;

[0049] Send the initial sequence range to the central node;

[0050] The range of sequences sent by the receiving central node.

[0051] In addition, the initial sequence range can be determined directly based on the number of data in the first data, and then sent to the central node, where the central node adjusts the initial sequence range to obtain the sequence range.

[0052] For example, when the number of data in the first data is 100, the initial sequence range is constructed as 1-100. At this time, the sequence range of 1-100 is sent to the central node. The central node determines that the first sequence to be dispatched is 1001. Then, the initial sequence range is adjusted to 1001-1100 as the final sequence range and returned to the current node.

[0053] S130. Combine the sequence range corresponding to the first data with the first data to obtain the first sequence.

[0054] After obtaining the sequence range corresponding to the first data, the sequence range can be directly combined with the data according to the order within the first data to generate the first sequence.

[0055] Optionally, the sequence range corresponding to the first data is combined with the first data to obtain the first sequence, including.

[0056] The first sequence is obtained by projecting and combining the sequence range corresponding to the first data with the first data.

[0057] When generating the first sequence, the sequence range corresponding to the first data can be directly projected and combined with the first data.

[0058] S140. Send the first sequence to the second operator, which is the parent operator of the current operator.

[0059] After obtaining the first sequence, the first sequence is sent to the second operator at the next higher level of the current operator.

[0060] By iteratively processing steps S110-S140, the construction of the overall sequence can be completed.

[0061] By adopting the technical solution of this application, the first data sent by the first operator is determined based on the current operator; the sequence range corresponding to the first data is determined; the sequence range corresponding to the first data is combined with the first data to obtain the first sequence; the first sequence is sent to the second operator, which is the superior operator of the current operator, so as to realize the complete construction of the sequence, thereby ensuring the processing efficiency of the database when the data volume is large.

[0062] Example 2

[0063] Figure 2 This invention provides a flowchart of another database compact sequence generation method. This embodiment further optimizes the process of determining the first data sent by the first operator based on the current operator in the aforementioned embodiments. This embodiment can be combined with various optional schemes in one or more of the above embodiments. Figure 2 As shown, the database compact sequence generation method of this embodiment may include the following steps:

[0064] S210. Based on the current operator, receive the first data sent by the first operator.

[0065] S220. Store the first data in the current operator until the remaining storage space of the current operator reaches the first preset storage space.

[0066] When processing the current operator, the current operator will store the first data in the current operator's storage space until the remaining storage space reaches the first preset storage space.

[0067] S230. Determine the sequence range corresponding to the first data.

[0068] S240. Combine the sequence range corresponding to the first data with the first data to obtain the first sequence.

[0069] S250. Send the first sequence to the second operator, where the second operator is the parent operator of the current operator.

[0070] S260. Based on the current operator, determine the second data to be sent by the first operator.

[0071] S270. In the first preset storage space, the first data is overwritten by the second data.

[0072] After uploading the first sequence corresponding to the first data, the system can continue to receive the second data sent by the first operator and repeat the operation. When receiving the second data, the system can directly overwrite the first data with the second data, thereby saving computation.

[0073] By adopting the technical solution of this application, the second data sent by the first operator is determined based on the current operator, and the first data is overwritten by the second data in the first preset storage space, thereby realizing the rapid utilization of the storage space and reducing the steps of deleting data, thus reducing the computational pressure.

[0074] Example 3

[0075] Figure 3 This invention provides a structural block diagram of a database compact sequence generation device, applicable to the generation of database compact sequences. This device can be implemented in hardware and / or software and can be configured in an electronic device with data processing capabilities. Figure 3 As shown, the database compact sequence generation apparatus of this embodiment may include: a first data determination module 310, a sequence range determination module 320, a first sequence generation module 330, and a first sequence sending module 340. Wherein:

[0076] The first data determination module 310 is used to determine the first data sent by the first operator based on the current operator; the first operator is a subordinate operator of the current operator; the first data is sequence data;

[0077] Sequence range determination module 320 is used to determine the sequence range corresponding to the first data;

[0078] The first sequence generation module 330 is used to combine the sequence range corresponding to the first data with the first data to obtain the first sequence;

[0079] The first sequence sending module 340 is used to send the first sequence to the second operator, which is the parent operator of the current operator.

[0080] Based on the above embodiments, optionally, the first data determination module 310 includes:

[0081] The first data receiving module is used to receive the first data sent by the first operator based on the current operator;

[0082] The storage cutoff module is used to store the first data into the current operator until the remaining storage space of the current operator reaches the first preset storage space.

[0083] Based on the above embodiments, optionally, after sending the first sequence to the second operator, where the second operator is the parent operator of the current operator, the method further includes:

[0084] Based on the current operator, determine the second data sent by the first operator;

[0085] In the first preset storage space, the first data is overwritten by the second data.

[0086] Based on the above embodiments, optionally, determining the sequence range corresponding to the first data includes:

[0087] Determine the number of data points in the first set of data;

[0088] Determine the sequence number corresponding to the first data in the first data from the central node;

[0089] The sequence number corresponding to the first data in the first data sent by the receiving central node is determined, and the sequence range corresponding to the first data is determined based on the number of data in the first data and the sequence number corresponding to the first data in the first data.

[0090] Based on the above embodiments, optionally, determining the sequence range corresponding to the first data includes:

[0091] Determine the number of data points in the first set of data;

[0092] Construct an initial sequence range based on the number of data points in the first set of data;

[0093] Send the initial sequence range to the central node;

[0094] The range of sequences sent by the receiving central node.

[0095] Based on the above embodiments, optionally, the sequence range corresponding to the first data is combined with the first data to obtain a first sequence, including:

[0096] The first sequence is obtained by projecting and combining the sequence range corresponding to the first data with the first data.

[0097] The database compact sequence generation apparatus provided in this embodiment of the invention can execute the database compact sequence generation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0098] Example 4

[0099] Figure 4 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0100] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0101] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0102] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the database compact sequence generation method.

[0103] In some embodiments, the database compact sequence generation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the database compact sequence generation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the database compact sequence generation method by any other suitable means (e.g., by means of firmware).

[0104] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0105] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0106] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

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

[0108] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0109] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0110] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0111] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A database compaction sequence generation method, characterized by, The method comprises the following steps: determining first data sent by a first operator based on a current operator; the first operator is a subordinate operator of the current operator; the first data is sequence data; determining a sequence range corresponding to the first data; combining the sequence range corresponding to the first data with the first data to obtain a first sequence; sending the first sequence to a second operator, which is a superior operator of the current operator.

2. The method of claim 1, wherein, The method comprises the following steps: determining first data sent by a first operator based on a current operator; receiving the first data sent by the first operator based on the current operator; 3. The method of claim 2, wherein, storing the first data to the current operator until the remaining storage space of the current operator reaches a first preset storage space. After sending the first sequence to the second operator, which is a superior operator of the current operator, the method further comprises the following steps: determining second data sent by the first operator based on the current operator; 4. The method of claim 1, wherein, covering the first data with the second data in the first preset storage space. The method comprises the following steps: determining the number of data in the first data; determining the sequence number corresponding to the first data in the first data to a center node; 5. The method of claim 1, wherein, receiving the sequence number corresponding to the first data in the first data sent by the center node, and determining the sequence range corresponding to the first data according to the number of data in the first data and the sequence number corresponding to the first data in the first data. The method comprises the following steps: determining the number of data in the first data; constructing an initial sequence range according to the number of data in the first data; sending the initial sequence range to a center node; 6. The method of claim 1, wherein, receiving the sequence range sent by the center node. The method comprises the following steps:

7. A database compaction sequence generating apparatus characterized by comprising: projecting and combining the sequence range corresponding to the first data with the first data to obtain the first sequence. The method comprises the following steps: a first data determination module for determining first data sent by a first operator based on a current operator; the first operator is a subordinate operator of the current operator; the first data is sequence data; a sequence range determination module for determining a sequence range corresponding to the first data; a first sequence generation module for combining the sequence range corresponding to the first data with the first data to obtain a first sequence; 8. The apparatus of claim 7, wherein, a first sequence sending module for sending the first sequence to a second operator, which is a superior operator of the current operator. The first data determination module comprises: a first data receiving module for receiving first data sent by a first operator based on a current operator; 9. An electronic device, comprising: a storage cut-off module for storing the first data to the current operator until the remaining storage space of the current operator reaches a first preset storage space. The electronic device comprises: at least one processor; and a memory connected in communication with the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the database compact sequence generation method in any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to implement the database compact sequence generation method in any one of claims 1-6 when executed.

Citation Information

Patent Citations

  • Global ID generation method and device, equipment and storage medium

    CN113064903A

  • Sequence generation method and device, electronic equipment and storage medium

    CN113111626A

  • Database sequence processing method and device, equipment and storage medium

    CN117725115A

  • Serial number generation method, system and device, computer equipment and storage medium

    CN117931825A

  • Cache file management method and device, electronic equipment and readable storage medium

    CN119938621A