Information processing method, device, terminal and storage medium
By setting the number of data read by each thread and updating the data identification value, the bottleneck problem of database data reading is solved, the jump and horizontal expansion of data reading is realized, duplicate development work is reduced, and performance is improved.
Patent Information
- Application Number
- CN202210203506.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-03
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2042-03-03
AI Technical Summary
There are bottlenecks in existing database data reading methods, especially because data reading caused by shared resources becomes a performance bottleneck in batch tasks. Different business scenarios require customized development of data reading code, resulting in an increase in repetitive workload.
By setting the number of data read by each thread, dividing the data into multiple segments, updating the value of the first data identification to reduce the pressure of data query, realizing the jump of data reading, avoiding paging queries, and using the same structured query language to repeat Use data to read code to achieve horizontal scaling.
It effectively reduces the pressure of database query, eliminates paging bottlenecks, reduces the workload of repeated customized development, realizes jump and horizontal expansion of data reading, and improves data reading performance.
Smart Images

Figure CN114579615B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of information technology, and in particular to an information processing method and device, a terminal and a storage medium. Background Art
[0002] Data is the foundation of the system. When building an application system, it is often necessary to process data in certain databases in batches, such as synchronizing the data to the target data storage (for example, relational database, document database, etc.) for business-driven, data statistical analysis, or as a basis for system and business monitoring. Batch processing tasks are generally divided into three parts: data reading, data processing, and data writing. Data processing and data writing can simply improve the throughput of batch processing tasks through asynchronous processing, but data reading often becomes a bottleneck for batch processing tasks due to shared resources. Summary of the invention
[0003] To solve the existing problems, the present disclosure provides an information processing method and device, a terminal and a storage medium.
[0004] The present disclosure adopts the following technical solutions.
[0005] An embodiment of the present disclosure provides an information processing method, which includes: determining whether a first data identifier is empty, and when it is determined that the first data identifier is empty, setting the first data identifier to an empty character, and setting the values of a first target number and a first variable, the first variable being the product of a second data identifier and the first target number; when it is determined that the first data identifier is not empty, setting the value of the first variable to the product of a third data identifier and the first target number; based on the first data identifier, the first target number and the first variable, executing data query and outputting data query results; determining the first data identifier with the largest value corresponding to the data in the data query result, and updating the value of the first data identifier according to the value.
[0006] Another embodiment of the present disclosure provides an information processing device, which includes: a determination module, configured to determine whether a first data identifier is empty, and when it is determined that the first data identifier is empty, set the first data identifier to an empty character, and set the values of a first target number and a first variable, the first variable being the product of a second data identifier and the first target number; when it is determined that the first data identifier is not empty, set the value of the first variable to the product of a third data identifier and the first target number; a data query module, configured to perform data query based on the first data identifier, the first target number and the first variable, and output a data query result; an update module, configured to determine the first data identifier with the largest value corresponding to the data in the data query result, and update the value of the first data identifier according to the value.
[0007] In some embodiments, the present disclosure provides a terminal, comprising: at least one memory and at least one processor; wherein the memory is used to store program codes, and the processor is used to call the program codes stored in the memory to execute the above-mentioned information processing method.
[0008] In some embodiments, the present disclosure provides a storage medium for storing program code, and the program code is used to execute the above-mentioned information processing method.
[0009] The embodiment of the present disclosure divides the read data into multiple segments by setting the number of data read by each thread, and by updating the value of the first data identifier, effectively reduces the pressure of data query and eliminates the paging bottleneck of the database in the later stage. The information processing method of the present disclosure has the characteristic of horizontal expansion, and different structured query languages can reuse the same reading class, reducing the workload of repeated custom development. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0011] Figure 1 is a flowchart of an information processing method according to an embodiment of the present disclosure.
[0012] Figure 2 A schematic flow chart of an information processing method according to some embodiments is shown.
[0013] Figure 3 It is a partial module used for an information processing device in some embodiments of the present disclosure.
[0014] Figure 4 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0016] It should be understood that the various steps described in the method embodiments of the present disclosure can be performed in sequence and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0017] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0018] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0019] It should be noted that the modification of “one” mentioned in the present disclosure is illustrative rather than restrictive, and those skilled in the art should understand that it should be understood as “one or more” unless otherwise clearly indicated in the context.
[0020] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0021] At present, there are usually two ways to read data from a database. One is to query one by one according to the database cursor. The disadvantage is that the query must be made in sequence, and there is no way to jump to the target data, resulting in no concurrent query. Data reading may become the bottleneck of the entire program. The other is to perform paging queries according to the number of pages and paging size set by the database. Concurrency can be achieved by designing different numbers of pages. The disadvantage is that the paging of the database is very slow in the end, affecting performance, and data reading may also become the bottleneck of the entire program. Therefore, the current data reading methods are either difficult to expand horizontally or have poor reading performance in the later stages of paging. In addition, each business scenario corresponds to a different structured query language (SQL), which requires customized development of data reading code.
[0022] Data task processing usually includes data reading, data processing and data writing, where the sources of data reading include networks, system interfaces, files, databases or other storage forms; data processing mainly refers to filtering, analyzing, summarizing, etc. the read data to generate the data to be written; data writing usually stores the processed data results or uses them to trigger notifications, print logs, etc.
[0023] Figure 1A flowchart of an information processing method of an embodiment of the present disclosure is provided. The information processing method of the present disclosure may include step 101, determining whether a first data identifier is empty, and when it is determined that the first data identifier is empty, setting the first data identifier to an empty character, and setting the values of a first target number and a first variable, the first variable being the product of a second data identifier and the first target number; when it is determined that the first data identifier is not empty, setting the value of the first variable to the product of a third data identifier and the first target number.
[0024] In some embodiments, the value of the first data identifier corresponds to the serial number of the data in the read data table. For example, assuming that there are 100 data in the data table to be read, the 100 data can be numbered, for example, from 1 to 100, and each data corresponds to a first data identifier. For example, if the value of the first data identifier is 35, it means that the data is numbered 35 in the data table. In some embodiments, if the first data identifier is empty, it indicates that this is the first time data is read for the data table, and initialization is performed according to the thread where the data to be read is located.
[0025] In some embodiments, the first target number corresponds to the number of data read by each thread. For example, if the amount of data read by each thread is 10, the first target number is 10, and the amount of data obtained by the data query is 10 data. In some embodiments, the first variable refers to the number of data that is skipped when reading the data in the data table. For example, assuming that the 31st data in the data table is to be read, the first variable is 30, that is, the first 30 data are skipped and the 31st data is read. When the first target number is 10, it means that the number of data read by 3 threads is skipped, and the second data identifier is 3 at this time. In some embodiments, when the first data identifier is not empty, it means that the data table has been read before. For example, when the 31st data in the data table has been read last time, when the first target number is 10, the value of the first data identifier is 40, because the 31st data to the 40th data were read last time. If the 55th data in the data table is to be read at this time, the value of the first variable is directly set to 50, and the 51st data to the 60th data are read, that is, the third data identifier is 5 at this time.
[0026] In some embodiments, the method of the present disclosure may further include step 102, executing a data query based on the first data identifier, the first target number and the first variable, and outputting a data query result. In some embodiments, after determining the above parameters, these parameters are passed into a structured query language program to execute the data query, and the queried return value is assigned to the data result list, that is, the data query result is output. For example, if the value of the first data identifier is 30, the first target number is 10, and the first variable is 50, the data query will start reading from the 51st data to the 60th data, and the data pointer will jump from the 30th data to the 51st data to start reading.
[0027] In some embodiments, the method of the present disclosure may further include step 103, determining the first data identifier with the largest value corresponding to the data in the data query result, and updating the value of the first data identifier according to the value. For example, assuming that the data query result is the 51st-60th data, the first data identifier with the largest value corresponding to the 51st-60th data is 60, at this time, the value of the first data identifier is updated to 60, and the pointer starts reading data from the 60th data when reading data next time.
[0028] Through this data reading method, the value of the first data identifier can be updated, and the same structured data query language can be reused when reading data subsequently, reducing repeated customization of data reading code. In addition, the embodiment of the present disclosure divides the read data into multiple segments (for example, 10 data as one data segment) by setting the number of data read by each thread (the first target number), and by updating the value of the first data identifier, effectively reduces the pressure of data query, eliminates the paging bottleneck of the database in the later stage, and achieves the effect of paging query data without paging query on the data, avoiding the problem of poor reading performance in the later stage of paging query.
[0029] In some embodiments, as described above, the second data identifier and the third data identifier correspond to the identifier of the thread that reads the data. For example, if the total number of threads of all machines that perform data reading is 6, there are 3 machines in total, and each machine has 2 threads, then the identifiers of all threads can be set to 0, 1, 2, 3, 4, and 5. When the thread with identifier 1 (i.e., the second thread) is used to read data, the 1st to 10th data read by the first thread (the thread identifier is 0) can be directly skipped, and the reading starts from the 11th data, and the 11th to 20th data are read. Similarly, when the 33rd data is to be read, the data read by the first three threads can be skipped, and the fourth thread (the thread identifier is 3) is called to read the 31st to 40th data. In this way, the data reading of the present application can be horizontally expanded, that is, the number of machines that perform data reading can be expanded. In addition, the jump of data reading is realized, and the problem of poor performance of late reading when using a database cursor to read data one by one and paging access is avoided.
[0030] In some embodiments, outputting the data query result includes: outputting the first target number of data immediately following the data corresponding to the first data identifier. As described above, if the first data identifier corresponds to the 30th data and the first target number is 10, the output data query result is the 31st-40th data. In this way, the data reading method disclosed in the present invention does not need to be paging, avoiding the problem of poor reading performance when reading data by paging, and reducing the query pressure of the database by jumping the data reading.
[0031] In some embodiments, the identifier SEGMENT_ID of the thread reading data is a function of the machine segment number MACHINE_ID, the number of threads of each machine THREAD_COUNT and the thread number THREAD_ID of each machine. In some embodiments, SEGMENT_ID=(MACHINE_ID–1)*(THREAD_COUNT)+THREAD_ID–1. In some embodiments, the scheduler is used to generate the machine segment ID and thread ID to generate the data segment ID (thread identifier), the number of machines is MACHINE_COUNT, and the MACHINE_IDs are numbered from 1 to MACHINE_COUNT in sequence, and the number of threads of each machine is THREAD_COUNT, and each machine has threads numbered from THREAD_ID 1 to THREAD-COUNT, and the data segment ID (SEGMENT_ID) is generated, SEGMENT_ID=(MACHINE_ID–1)*(THREAD_COUNT)+THREAD_ID-1, so that each thread of each machine will get a SEGMENT_ID. For example, there are 3 machines, numbered 1, 2, and 3; each machine has 2 threads, numbered 1 and 2, then the SEGMENT_ID of the second thread of the first machine is (1-1)*2+2–1, which is 1.
[0032] Combine the following Figure 2 An example is given to better understand the technical solution of the present invention. Figure 2As shown, first determine whether the first data identifier is empty. If it is empty, it indicates that this is the first time that the data reading method is called for the data table, and the initial value is set. In some embodiments, the first data identifier is set to a null character. For example, the first target number is set to 10, which means that each thread reads 10 data. The first variable corresponds to the number of data to be skipped when reading data, which is the product of the thread identifier and the first target number. For example, if the 31st data is to be read, the 1st-30th data read by the first three threads are skipped, and the fourth thread is called to read the 31st data. Of course, the 31st-40th data read by the thread can also be output. In addition, the 31st data of the target data can also be screened from the data read by the thread. In some embodiments, if the first data identifier is not empty, it means that data has been read for the data table before. For example, if the 31st data has been read above, the value of the first data identifier will be updated to 40. At this time, if the 55th data is to be read, the 1st to 50th data read by the first five threads are skipped, and the sixth thread is called to read the 51st to 60th data. At this time, the read pointer can jump from the 40th data to the 51st to 60th data. Therefore, when a thread is called to read the corresponding data, the data read by the thread corresponding to the previous thread identifier can be skipped, realizing the jump of data reading, avoiding the low efficiency of reading data one by one and the poor performance of the later reading of paging data.
[0033] When the above parameters are determined, they can be input into the structured query language program to execute data query and obtain the corresponding return value, so that the return value can be assigned to the result list and the data query result can be output. Then, the data with the largest value of the first data identifier is determined from the returned values through reflection and annotation, and the value of the first data identifier is updated, thereby updating the entire structured query language program so that the program can be reused until all data is read. For example, if the output is the 31st to 40th data, the value of the first data identifier is updated to 40; if the output is the 51st to 60th data, the value of the first data identifier is updated to 60. In this way, by updating the value of the first data identifier, the structured query language code can be reused and the cost of repeated code development can be reduced.
[0034] By adopting the data query method disclosed in the present invention, horizontal expansion can be performed, and the reading capacity can be expanded by using multiple machines and multiple threads. In addition, the corresponding structured query language is generated according to the unique attribute of the data and the data segment ID, which effectively reduces the query pressure of the database. By updating the value of the first data identifier, the reuse of the data query code is realized, reducing the cost of code development. In addition, the data query method disclosed in the present invention eliminates the reading bottleneck in the later stage of paging query.
[0035] The embodiments of the present disclosure also provide an information processing device 600. The information processing device 600 includes a determination module 601, a data query module 602, and an update module 603. In some embodiments, the determination module 601 is configured to determine whether the first data identifier is empty. When the first data identifier is determined to be empty, the first data identifier is set to an empty character, and the values of the first target number and the first variable are set, and the first variable is the product of the second data identifier and the first target number; when the first data identifier is determined to be not empty, the value of the first variable is set to the product of the third data identifier and the first target number. In some embodiments, the data query module 602 is configured to perform a data query based on the first data identifier, the first target number, and the first variable, and output a data query result. In some embodiments, the update module 603 is configured to determine the first data identifier with the largest value corresponding to the data in the data query result, and update the value of the first data identifier according to the value.
[0036] It should be understood that the contents described about the information processing method are also applicable to the information processing device 600 used here, and for the sake of simplicity, they are not described in detail here.
[0037] In some embodiments, the value of the first data identifier corresponds to the sequence number of the data in the read data table. In some embodiments, the first target number corresponds to the number of data read by each thread. In some embodiments, the second data identifier and the third data identifier correspond to the identifier of the thread that reads the data. In some embodiments, outputting the data query result includes: outputting the first target number of data immediately following the data corresponding to the first data identifier. In some embodiments, the identifier SEGMENT_ID of the thread that reads the data is a function of the machine segment number MACHINE_ID, the number of threads of each machine THREAD_COUNT and the thread number THREAD_ID of each machine. In some embodiments, SEGMENT_ID=(MACHINE_ID–1)*(THREAD_COUNT)+THREAD_ID–1. In some embodiments, the machine segment number and the thread number of each machine are generated by a scheduler to generate the identifier of the thread that reads the data.
[0038] In addition, the present disclosure also provides a terminal, including: at least one memory and at least one processor; wherein the memory is used to store program codes, and the processor is used to call the program codes stored in the memory to execute the above-mentioned information processing method.
[0039] In addition, the present disclosure also provides a computer storage medium, which stores program codes, and the program codes are used to execute the above-mentioned information processing method.
[0040] The above describes the information processing method and device of the present disclosure based on the embodiments and application examples. In addition, the present disclosure also provides a terminal and a storage medium, which are described below.
[0041] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 700 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0042] like Figure 4 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0043] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0044] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0045] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0046] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0047] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0048] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method of the present disclosure.
[0049] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0050] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0051] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0052] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0053] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0054] According to one or more embodiments of the present disclosure, there is provided an information processing method, which includes: determining whether a first data identifier is empty, and when it is determined that the first data identifier is empty, setting the first data identifier to an empty character, and setting the values of a first target number and a first variable, the first variable being the product of a second data identifier and the first target number; when it is determined that the first data identifier is not empty, setting the value of the first variable to the product of a third data identifier and the first target number; based on the first data identifier, the first target number and the first variable, executing a data query and outputting a data query result; determining the first data identifier having the largest value corresponding to the data in the data query result, and updating the value of the first data identifier according to the value.
[0055] According to one or more embodiments of the present disclosure, the value of the first data identifier corresponds to the sequence number of the data in the read data table.
[0056] According to one or more embodiments of the present disclosure, the first target number corresponds to the amount of data read by each thread.
[0057] According to one or more embodiments of the present disclosure, the second data identifier and the third data identifier correspond to an identifier of a thread that reads data.
[0058] According to one or more embodiments of the present disclosure, outputting the data query result includes: outputting the first target number of data immediately following the data corresponding to the first data identifier.
[0059] According to one or more embodiments of the present disclosure, the identifier SEGMENT_ID of the thread reading data is a function of the machine segment number MACHINE_ID, the number of threads THREAD_COUNT of each machine, and the thread number THREAD_ID of each machine.
[0060] According to one or more embodiments of the present disclosure, SEGMENT_ID=(MACHINE_ID−1)*(THREAD_COUNT)+THREAD_ID−1.
[0061] According to one or more embodiments of the present disclosure, a scheduler is used to generate the machine slice number and the thread number of each machine to generate an identifier of the thread that reads data.
[0062] According to one or more embodiments of the present disclosure, there is provided an information processing device, comprising: a determination module, configured to determine whether a first data identifier is empty; when it is determined that the first data identifier is empty, setting the first data identifier to an empty character, and setting the values of a first target number and a first variable, the first variable being the product of a second data identifier and the first target number; when it is determined that the first data identifier is not empty, setting the value of the first variable to the product of a third data identifier and the first target number; a data query module, configured to perform data query based on the first data identifier, the first target number and the first variable, and output a data query result; an update module, configured to determine the first data identifier with the largest value corresponding to the data in the data query result, and update the value of the first data identifier according to the value.
[0063] According to one or more embodiments of the present disclosure, a terminal is provided, comprising: at least one memory and at least one processor; wherein the at least one memory is used to store program code, and the at least one processor is used to call the program code stored in the at least one memory to execute any one of the methods described above.
[0064] According to one or more embodiments of the present disclosure, a storage medium is provided, wherein the storage medium is used to store program code, and the program code is used to execute the above method.
[0065] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0066] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0067] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An information processing method, characterized in that: include: Determine whether the first data identifier is empty, and when it is determined that the first data identifier is empty, set the first data identifier to a null character, and set the values of the first target number and the first variable, the first variable being the product of the second data identifier and the first target number; when it is determined that the first data identifier is not empty, set the value of the first variable to the product of the third data identifier and the first target number; Based on the first data identifier, the first target number and the first variable, execute data query and output data query result; Determine the first data identifier having the largest value corresponding to the data in the data query result, and update the value of the first data identifier according to the value; The first target number corresponds to the amount of data read by each thread, and the second data identifier and the third data identifier correspond to the identifier of the thread that reads the data.
2. The information processing method according to claim 1, characterized in that: The value of the first data identifier corresponds to the sequence number of the data in the read data table.
3. The information processing method according to claim 1, characterized in that: The output data query results include: Output the first target number of data immediately following the data corresponding to the first data identifier.
4. The information processing method according to claim 1, characterized in that: The identifier of the thread reading the data is a function of the machine shard number, the number of threads per machine, and the thread number per machine.
5. The information processing method according to claim 4, characterized in that: The identifier of the thread reading the data = (machine shard number – 1) * number of threads per machine + thread number per machine – 1.
6. The information processing method according to claim 4, characterized in that: The scheduler is used to generate the machine slice number and the thread number of each machine to generate an identifier of the thread that reads data.
7. An information processing device, characterized in that: The information processing device comprises: a determination module configured to determine whether a first data identifier is empty, and when it is determined that the first data identifier is empty, set the first data identifier to a null character, and set a first target number and a value of a first variable, wherein the first variable is a product of a second data identifier and the first target number; and when it is determined that the first data identifier is not empty, set the value of the first variable to be a product of a third data identifier and the first target number; a data query module, configured to perform data query based on the first data identifier, the first target number and the first variable, and output a data query result; an updating module, configured to determine the first data identifier having the largest value corresponding to the data in the data query result, and update the value of the first data identifier according to the value; The first target number corresponds to the amount of data read by each thread, and the second data identifier and the third data identifier correspond to the identifier of the thread that reads the data.
8. A terminal, comprising: at least one memory and at least one processor; The at least one memory is used to store program codes, and the at least one processor is used to call the program codes stored in the at least one memory to execute the information processing method according to any one of claims 1 to 6.
9. A storage medium for storing a program code, wherein the program code is used to execute the information processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
An anomaly recognition method and device of an application program
CN109343853A
Data storage method, device, equipment and storage medium
CN110737663A
Data query method and device
CN110909022A
Distributed task processing method, related equipment, system and storage medium
CN111061762A
Data query method and device
CN111737257A
