Data processing method, device, equipment and medium
By dividing the data sequence into subsequences and performing splicing and filling bit processing within the subsequences, the problems of memory fragmentation and data distribution changes caused by differences in data volume are solved, and efficient and accurate data processing is achieved.
Patent Information
- Application Number
- CN202411732744.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-11-28
AI Technical Summary
When processing different batches of data, the existing technology causes unstable memory usage due to differences in data volume, resulting in fragmented memory allocation, affecting data processing efficiency. In addition, the existing splicing method may cause changes in data distribution characteristics, affecting data processing accuracy.
The data sequence is divided into multiple subsequences, and splicing is performed within each subsequence. The data length is adjusted using padding bits to ensure that the data splicing within each subsequence meets the target length and maintains the data order within the subsequence range, reducing the impact of disorder on the overall data distribution.
While ensuring the accuracy of data processing, it reduces the void rate of spliced data, fully utilizes hardware resources, avoids memory fragmentation, and improves data processing efficiency.
Smart Images

Figure CN119621006B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of data processing and natural language processing technology, and specifically to a data processing method, device, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] Artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.
[0003] With the development of artificial intelligence (AI), a growing number of applications are achieving performance far exceeding that of traditional algorithms. Deep learning is a data-intensive algorithm. To improve hardware resource utilization, multiple batches of data can be serially fed into the processor, allowing the processor to execute data processing steps based on each batch of data. In this scenario, the varying amounts of data in different batches inevitably lead to fluctuations in hardware performance parameters, such as changes in memory usage, which in turn leads to fragmented memory allocation and affects data processing efficiency.
[0004] The approaches described in this section are not necessarily approaches that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any approach described in this section is prior art simply by virtue of its inclusion in this section. Similarly, unless otherwise indicated, the issues raised in this section should not be considered as having been recognized in any prior art. Summary of the Invention
[0005] The present disclosure provides a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product.
[0006] According to one aspect of the present disclosure, a data processing method is provided, comprising: obtaining a data sequence comprising a plurality of initial data of different lengths; dividing the data sequence into a plurality of subsequences, wherein the number of initial data included in each of the plurality of subsequences does not exceed a quantity threshold; performing a first operation based on each of the plurality of subsequences to obtain at least one spliced data corresponding to each subsequence, wherein the first operation for each subsequence comprises: in response to determining that a first data set that satisfies a first condition exists in the subsequence, wherein, according to the first condition, the sum of the lengths of the plurality of initial data in the first data set is not greater than a target length, based on The first data set determines the spliced data having the target length; in response to determining that the subsequence also includes second data, splicing the second data with padding bits to obtain spliced data having the target length; and in response to determining that the first data set does not exist in the subsequence, for each initial data in the subsequence, splicing the initial data with padding bits to obtain spliced data having the target length; and based on the arrangement order of the multiple subsequences, sending at least one spliced data corresponding to each subsequence to a processor, so that the processor can use the memory space corresponding to the target length to perform data processing on the multiple spliced data in sequence.
[0007] According to another aspect of the present disclosure, a data processing device is provided, comprising: an acquisition unit configured to acquire a data sequence comprising a plurality of initial data of different lengths; a segmentation unit configured to segment the data sequence into a plurality of subsequences, wherein the number of initial data included in each of the plurality of subsequences does not exceed a quantity threshold; a first operation unit configured to perform a first operation based on each of the plurality of subsequences to obtain at least one spliced data corresponding to each subsequence, wherein the first operation unit comprises: a first splicing subunit configured to, for each subsequence, in response to determining that a first data set that satisfies a first condition exists in the subsequence, wherein, according to the first condition, the sum of the lengths of the plurality of initial data in the first data set is not greater than a target length, determining the spliced data having the target length based on the first data set; a second splicing subunit, configured to, in response to determining that the subsequence also includes second data, splice the second data with padding bits to obtain the spliced data having the target length; and a third splicing subunit, configured to, in response to determining that the first data set does not exist in the subsequence, splice the initial data with padding bits for each initial data in the subsequence to obtain the spliced data having the target length; and a sending unit, configured to send at least one spliced data corresponding to each subsequence to a processor based on the arrangement order of the multiple subsequences, so that the processor can use the memory space corresponding to the target length to perform data processing on the multiple spliced data in sequence.
[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above-mentioned data processing method.
[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the above data processing method.
[0010] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program can implement the above data processing method when executed by a processor.
[0011] According to one or more embodiments of the present disclosure, the proportion of valid data bits in the spliced data can be increased while reducing the impact of out-of-order splicing of data on data distribution characteristics, thereby improving data processing efficiency while ensuring data processing accuracy.
[0012] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings illustrate exemplary embodiments and constitute a part of the specification. Together with the description of the specification, they serve to explain exemplary implementation of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals designate similar, but not necessarily identical, elements.
[0014] Figure 1 A schematic diagram illustrating an exemplary system in which the various methods described herein may be implemented according to exemplary embodiments of the present disclosure;
[0015] Figure 2 A flow chart showing a data processing method according to an exemplary embodiment of the present disclosure is shown;
[0016] Figure 3A-3C A schematic diagram illustrating a data processing process according to an exemplary embodiment of the present disclosure is shown;
[0017] Figure 4 shows a structural block diagram of a data processing device according to an exemplary embodiment of the present disclosure;
[0018] Figure 5 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0019] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0020] In this disclosure, unless otherwise specified, the use of terms such as "first" and "second" to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements. Such terms are only used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of the element, while in some cases, based on the context of the description, they may also refer to different instances.
[0021] The terms used in the descriptions of the various examples described in this disclosure are for the purpose of describing specific examples only and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element may be one or more. In addition, the term "and / or" used in this disclosure encompasses any one and all possible combinations of the listed items.
[0022] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0023] Figure 1 FIG2 is a schematic diagram of an exemplary system 100 in which the various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 can be configured to execute one or more applications.
[0024] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the execution of the data processing method.
[0025] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0026] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may, in turn, utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
[0027] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to send data processing requests or initial data to be processed. The client device may provide an interface that enables the user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure can support any number of client devices.
[0028] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux, or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. The client device is capable of executing various different applications, such as various Internet-related applications, communication applications (eg, email applications), Short Message Service (SMS) applications, and may use various communication protocols.
[0029] The network 110 may be any type of network known to those skilled in the art that can support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0030] Server 120 may include one or more general-purpose computers, specialized server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0031] The computing units in the server 120 may run one or more operating systems including any of the operating systems described above as well as any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, and the like.
[0032] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display the data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
[0033] In some embodiments, server 120 may be a distributed system server or a server integrated with blockchain. Server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host equipped with artificial intelligence technology. A cloud server is a host product within the cloud computing service system that addresses the management difficulties and poor scalability of traditional physical hosts and virtual private servers (VPS) services.
[0034] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in a variety of locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.
[0035] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.
[0036] Figure 1 The system 100 may be configured and operated in various ways to enable application of the various methods and apparatuses described in accordance with the present disclosure.
[0037] When processing multiple batches of data with different data volumes, the instability of the data volume will lead to unstable memory usage, which in turn leads to fragmentation of memory allocation.
[0038] In response to this problem, one solution in the related art is to fill the unequal length initial data with equal length data by filling with zeros. However, in this case, in order to meet the filling needs of all the initial data as much as possible, the length of the equal length data needs to be set with reference to the maximum length of the initial data, resulting in too many zero-filling bits in the filled equal length data, and the data void rate is too high, thereby reducing the data processing efficiency. Another solution in the related art is to group, combine and splice the full amount of initial data. For example, when the initial data includes data A with a length of 6, data B with a length of 1, data C with a length of 7, and data D with a length of 2, data A and data D can be combined and spliced into spliced data X with a length of 8, and data B and data C can be combined and spliced into spliced data Y with a length of 8, that is, equal length spliced data can be obtained while avoiding data voids. However, this method will cause the data arrangement to be disordered, greatly changing the data distribution characteristics, which may cause large deviations in the data processing results, affecting the accuracy of data processing.
[0039] Based on this, the present disclosure provides a data processing method. After receiving a data sequence consisting of initial data of unequal lengths, the data sequence is divided into multiple subsequences. Within each subsequence, splicing is attempted. When a first data set that meets the splicing conditions exists, the multiple initial data in that set are spliced into spliced data of the target length. For initial data that does not meet the splicing conditions, the splicing is performed using padding bits. In this case, the spliced initial data is only disordered within the subsequence range, with little impact on the overall sample distribution. This ensures data processing accuracy while achieving data splicing and reducing the void rate of the resulting equal-length data.
[0040] Figure 2 FIG. 1 shows a flow chart of a data processing method according to an exemplary embodiment of the present disclosure. Figure 2 As shown, the method 200 includes:
[0041] Step S210: Acquire a data sequence including a plurality of initial data of different lengths;
[0042] Step S220: dividing the data sequence into a plurality of subsequences, wherein the amount of initial data included in each of the plurality of subsequences does not exceed a quantity threshold;
[0043] Step S230: Perform the following first operation on each subsequence of the plurality of subsequences to obtain at least one spliced data corresponding to each subsequence:
[0044] Step S231: In response to determining that a first data set that satisfies a first condition exists in the subsequence, wherein, according to the first condition, a sum of lengths of a plurality of initial data in the first data set is not greater than a target length, determining, based on the first data set, concatenated data having the target length;
[0045] Step S232: In response to determining that the subsequence further includes second data, concatenate the second data with padding bits to obtain concatenated data having the target length; and
[0046] Step S233: In response to determining that the first data set does not exist in the subsequence, for each initial data in the subsequence, concatenate the initial data with padding bits to obtain concatenated data having the target length; and
[0047] Step S240: Based on the arrangement order of the multiple subsequences, send at least one spliced data corresponding to each subsequence to a processor, so that the processor can perform data processing on the multiple spliced data in sequence using a memory space corresponding to the target length.
[0048] By applying the above-mentioned data processing method 200, it is possible to divide the data sequence into multiple subsequences after receiving a data sequence consisting of multiple initial data of unequal lengths, and perform a first operation in each subsequence to convert the initial data into spliced data with a target length. Specifically, in the first operation, it can be based on a first condition (i.e., data splicing condition) to attempt splicing, when there is a first data set that meets the splicing condition, multiple initial data in the set are spliced, and spliced data with a target length is obtained based on the splicing result, and the initial data that does not meet the splicing condition is spliced using padding bits. In this case, the ordinal difference of the spliced initial data in the original data sequence does not exceed the length of the subsequence, that is, the data sequence of the initial data will only be locally disordered within the subsequence range, and the combined splicing process of the data has little effect on the overall data distribution characteristics. Thus, the splicing of the initial data can be achieved while ensuring the accuracy of data processing, reducing the void rate of the spliced data with the target length, facilitating data processing based on the fixed memory space of the processor, making full use of hardware resources, avoiding memory fragmentation, ensuring the stability of hardware performance in the data processing process, and effectively improving data processing efficiency.
[0049] In some examples, step S220 may be based on a quantity threshold to segment the data sequence so that each subsequence includes as many initial data as possible. For example, when the initial sequence includes 120 initial data and the quantity threshold is 6, it can be divided into 20 subsequences with a capacity of 6. In some examples, the quantity threshold may be set in advance manually based on experience. As previously mentioned, according to the data processing method 200 provided by the present disclosure, the data that can be spliced is searched within the subsequence. Therefore, the ordinal difference between the multiple initial data in the spliced first data set in the original data sequence does not exceed the quantity threshold of the initial data included in the subsequence. It can be seen that the quantity threshold can constrain the degree of disorder of the sequence of the spliced data compared to the initial data sequence, that is, it can constrain the degree of influence of the data splicing operation on the data distribution characteristics. In this case, the quantity threshold can be determined in advance through testing or theoretical simulation to ensure that the degree of influence of the data splicing operation on the data distribution characteristics does not exceed the preset threshold, thereby ensuring the accuracy of the data processing results.
[0050] In some examples, the processor in step S240 may also be a distributed inference system built on multiple processing cores, thereby utilizing multiple processing cores to perform parallel data processing. In this case, by distributing the spliced data of equal length to multiple processing cores, the hardware performance parameters of each processing core can be guaranteed to be consistent, facilitating the management of parallel processing processes in the distributed system and thereby improving data processing efficiency.
[0051] According to some embodiments, the first data set in each subsequence is determined by: determining the length of each initial data in the subsequence; and determining whether the first data set exists in the subsequence based on the length of each initial data in the subsequence. By determining the first data set for splicing based on the length of each initial data in the subsequence, a more comprehensive and accurate splicing combination strategy can be obtained, thereby reducing the hole rate of the spliced data and improving data processing efficiency.
[0052] In some examples, in step S231, multiple first data sets can be determined based on the first condition, and then splicing can be performed in the subsequence based on multiple groups of initial data to increase the proportion of valid data bits in the spliced data and reduce the data void rate, thereby making more effective use of hardware resources and improving data processing efficiency.
[0053] In some examples, the existence of the first data set can also be determined based on the length of a portion of the initial data in each subsequence. For example, the length of each initial data in the subsequence can be sequentially obtained until a preset number of first data sets can be determined therefrom, and then the preset number of first data sets can be spliced together. This can limit the amount of initial data to be spliced in each subsequence, thereby preventing excessive changes in the distribution characteristics of the initial data sequence and ensuring data processing accuracy.
[0054] According to some embodiments, determining the length of each initial data in the subsequence includes sequentially performing a read operation on each initial data in the subsequence, wherein the read operation includes determining the length of each initial data as the initial data is read. Thus, the length of the initial data can be calculated while the initial data is being read, eliminating the need to perform additional operations to obtain the length of the initial data before reading and processing the initial data, thereby improving data processing efficiency.
[0055] In some examples, determining the length of each initial data element in the subsequence can be achieved through other means. For example, the initial data element may include explicit data length information, and the data length can be determined based on this explicit information. For another example, when the initial data element is in array form, a length acquisition function can be used to obtain the array length, i.e., the length of the initial data element.
[0056] According to some embodiments, determining whether the first data set exists in the subsequence based on the length of each initial data in the subsequence includes: initializing a data space sequence, wherein the number of data spaces in the data space sequence is not less than the number threshold, and the size of each data space is equal to the target length; and sequentially performing the following second operation on each initial data in the subsequence: in response to determining that there is at least one first data space in the plurality of data spaces that satisfies a second condition, wherein, according to the second condition, the first data space is a non-empty data space and the remaining space size of the first data space is not less than the length of the initial data, determining a target data space from the at least one first data space; placing the initial data in the target data space; and in response to determining that the first data space does not exist in the data space sequence, placing the initial data in an empty data space in the data space sequence; and determining whether the first data set exists in the subsequence based on the distribution of each initial data in the subsequence in the data space sequence. In this way, the initial data in the subsequence can be placed in the data space by traversal, and finally, a combination splicing strategy of the initial data is determined based on the distribution of the initial data in each data space, thereby more efficiently obtaining spliced data.
[0057] As previously described, in steps S231-S233, the initial data that meet the splicing conditions are spliced together, while the initial data that does not meet the splicing conditions are spliced with padding bits. In this case, by applying the above-mentioned method, the data space can be used to record the splicing information of the initial data. That is, the initial data that meets the splicing conditions are placed in the same data space, and the initial data that does not meet the splicing conditions are allocated to a separate data space. In this way, the combination splicing strategy of the initial data can be determined based on the distribution of the initial data in each data space, thereby more efficiently obtaining spliced data.
[0058] As previously mentioned, in some examples, the length of the initial data can be calculated while reading the initial data to more efficiently obtain the length information of the initial data. In this case, each initial data in the subsequence can be traversed and read, and the length of the initial data can be calculated during the reading process. The second condition for detecting the first data space is then determined based on the length information, thereby improving the efficiency of the second operation and more efficiently placing each initial data into the data space sequence.
[0059] According to some embodiments, determining the target data space from the at least one first data space includes determining the first data space with the largest remaining space among the at least one first data space as the target data space. This allows, when traversing the initial data in the subsequence, to select the data space with the largest remaining space as the target data space for the current initial data. This implements data splicing based on a greedy strategy, maximizing the proportion of valid data bits in the spliced data and reducing the data hole rate caused by padding bits, thereby more fully utilizing hardware resources and improving data processing efficiency.
[0060] The following example illustrates the operation of processing initial data based on a greedy strategy to obtain spliced data provided by the present disclosure:
[0061] In this example, the subsequence number threshold is 6. The following describes an exemplary implementation of the first operation for a subsequence with a capacity of 6: for 6 initial data with data lengths of 60, 40, 30, 20, 40, and 40, respectively, the following traversal steps can be performed to obtain concatenated data with a target length of 80:
[0062] Step S1, initialize 6 data spaces of size 80;
[0063] Step S2: Process data 1 with a length of 60. At this time, all data spaces are empty, so data 1 is placed in data space a. The remaining space of data space a is 20.
[0064] Step S3: Process data 2 with a length of 40. Since the remaining space of data space a is 20, which is insufficient to accommodate data 2, data 1 is placed in the new data space b, and the remaining space of data space b is 40.
[0065] Step S4: Processing data 3 of length 30. When comparing the maximum remaining space, the remaining space of data spaces a and b is 20 and 40 respectively. Data space b can accommodate data 3, so data 3 is placed in data space b. The remaining space of data space b is 10.
[0066] Step S5: Processing data 4 of length 20. When comparing the maximum remaining space, the remaining space of data spaces a and b are 20 and 10 respectively. Data space a can accommodate data 4, so data 4 is placed in data space a. The remaining space of data space a is 0.
[0067] Step S6: Processing data 5 of length 40. When comparing the maximum remaining space, the remaining space of data spaces a and b is 0 and 10 respectively, which is insufficient to accommodate data 4. Therefore, data 5 is placed in a new data space c, and the remaining space of data space c is 40.
[0068] Step S7: Process data six with a length of 40. When comparing the maximum remaining space, the remaining space sizes of data spaces a, b, and c are 0, 10, and 40 respectively. Data space c can accommodate data six, so data six is placed in data space c.
[0069] By executing the above traversal steps, three first data sets can be determined based on the data spaces a, b, and c, and then three spliced data of equal length can be obtained by splicing them together.
[0070] In some examples, processing the initial data based on the greedy strategy to obtain the spliced data can be implemented using the following steps:
[0071] Step S11: Initialize multiple data spaces. In this example, when the quantity threshold is buffer_size and the target length is max_length, the remaining space of buffer_size sets can be initialized.
[0072] Step S12: construct an array of length buffer_size, and use the array to record the remaining space sizes of multiple sets. The initial value of the remaining space size of the first set can be set to max_length, and the initial values of the remaining space sizes of the remaining sets can be non-positive numbers, that is, the remaining sets are made illegal spaces, to ensure that the initial data can be placed in the above-mentioned buffer_size sets in order.
[0073] Step S13: construct a data element list for storing the subsequence currently being processed. The data element list has a capacity of buffer_size and is used to store buffer_size initial data in the subsequence.
[0074] Step S14: Use a while loop to traverse the initial data in the list, and execute the following steps S15 to S18 for each initial data:
[0075] Step S15: Determine the length of the initial data. In some examples, the length of each initial data may be determined while reading.
[0076] Step S16: Search the array for the value with the largest remaining space, and then determine the set with the largest remaining space (ie, the data space).
[0077] Step S17: When the length of the currently processed initial data is smaller than the maximum remaining space found, the initial data is placed into the corresponding set with the largest remaining space.
[0078] Step S18: When the set with the largest remaining space is insufficient to fill the currently processed initial data, a new legal set needs to be opened (ie, the value of the remaining space size of the new set is set to max_length), and the initial data is placed in the new set.
[0079] By executing steps S15-S18 for each data item, the target data space for storing the initial data is determined based on the length of the initial data and the remaining space in the collection. After all the initial data are traversed, data splicing can be performed based on the distribution of the initial data in each collection (data space) to obtain spliced data of equal length.
[0080] According to some embodiments, determining whether the first data set exists in the subsequence based on the length of each initial data in the subsequence includes: reordering the subsequence based on the length of each initial data in the subsequence to obtain a reordered subsequence; and determining whether the first data set exists in the subsequence based on the first initial data and the last initial data in the reordered subsequence. Thus, by reordering the subsequence based on the length of the initial data, sort padding can be implemented based on the sorting result, minimizing the proportion of padding bits in the spliced data, that is, reducing the data hole rate and improving data processing efficiency.
[0081] In some examples, the sorting and filling operation for the full amount of initial data in the subsequence can be implemented in the following manner: after the subsequence is reordered based on the length of each initial data in the subsequence, the first data set is attempted to be obtained from the head and tail of the rearranged subsequence in sequence. For example, when the rearranged subsequence includes four initial data D1, D2, D3, and D4, D1 and D4 can be taken as a pair, and D2 and D3 can be taken as a pair. When the sum of the lengths of D1 and D4 meets the first condition, the spliced data can be obtained by splicing based on D1 and D4. When the sum of the lengths of D2 and D3 meets the first condition, the spliced data can be obtained by splicing based on D2 and D3. In this embodiment, although the subsequence needs to be reordered and the data is disordered to a greater extent, by selecting long and short data from the head and tail of the rearranged subsequence for splicing, the first data set can be determined more efficiently, and the proportion of padding bits in the spliced data can be minimized, thereby improving data processing efficiency.
[0082] According to some embodiments, determining the spliced data having the target length based on the first data set in step S231 includes: in response to determining that the sum of the lengths of the plurality of initial data in the first data set is less than the target length, splicing the plurality of initial data in the first data set and padding bits to obtain the spliced data. In this way, the spliced data can be padded with padding bits to achieve length alignment of the spliced data.
[0083] In some examples, the padding bits may be zero element bits to reduce the characteristic that the padding bits affect valid data bits (ie, a data segment corresponding to the original data in the concatenated data).
[0084] According to some embodiments, the initial data is text data, and the step S240 of using a processor to perform data processing on multiple spliced data in sequence includes: using a processor to input the multiple spliced data into a language model based on deep learning in sequence, so that the language model can perform model reasoning based on the multiple spliced data. Thus, before using the language model for reasoning, the sample data used to input the language model can be preprocessed so that the length of all processed sample data input to the model is consistent, thereby ensuring the stability of the hardware performance parameters. By applying the method 200 provided by the present disclosure to preprocess the sample data, the data disorder caused by the data combination and splicing operation in the preprocessing process can be reduced, that is, the distribution characteristics of the text data are affected as little as possible, thereby ensuring the accuracy of the model reasoning results. At the same time, by applying the above method 200, the proportion of valid data bits in the sample data of the input model can be increased, the sample data void rate can be reduced, the data throughput of the model can be increased, and the reasoning efficiency can be improved.
[0085] In some examples, the above-mentioned process of making the language model perform reasoning based on multiple spliced data can be applied to the model training process, for example, it can be to perform fine-tuning training or alignment training on the pre-trained language model. By using task data in the vertical field to perform fine-tuning training on the pre-trained model, the reasoning performance of the model in the vertical field can be improved. By using specific sample data to perform alignment training on the pre-trained model, the output results of the model can be adjusted more accurately so that the model reasoning results can be aligned with the predetermined expectations.
[0086] Figure 3A-3C A schematic diagram of the data processing process according to an exemplary embodiment of the present disclosure is shown, wherein a subsequence is obtained after the initial data sequence is segmented. In this example, the subsequence to be processed includes six initial data A, B, C, D, E, and F. Figure 3AWhen the target length of the spliced data is set to 8, if padding bits (such as zero elements) are used to fill the initial data to the target length, it will result in a data void rate of more than 50%, ineffectively occupying hardware resources and affecting data processing efficiency.
[0087] Figure 3B An example of reordering the initial data sequence and then determining the first data set to be merged to obtain the spliced data based on the reordering result is shown. Figure 3B As shown in FIG, by rearranging the subsequences based on the length of the initial data, the rearranged subsequences of A, E, B, F, C, and D can be obtained. On this basis, the first data set can be obtained from the head and tail of the rearranged subsequences to obtain Figure 3B The three first data sets A+D, E+C and B+F are shown to obtain spliced data with target length.
[0088] As previously mentioned, the reordering-based first operation can minimize the hole rate in the spliced data. However, it requires reordering the entire initial data in the subsequence, which involves an additional sorting operation, resulting in additional resource usage and further data disorder, changing the data distribution characteristics of the original data sequence. In actual application scenarios, the specific implementation of the first operation can be determined based on actual needs.
[0089] Figure 3C An example of processing the initial data in the subsequence based on the greedy strategy to obtain the spliced data is shown. Figure 3C As shown, greedy processing can be performed through the following traversal steps:
[0090] Step S11, put A into data space 01;
[0091] Step S12: Since the remaining space in data space 01 is insufficient to store B, B is placed in data space 02.
[0092] Step S13: Since the remaining space of data space 01 is insufficient to accommodate C, the remaining space of data space 02 can accommodate C, so C is placed in data space 02.
[0093] Step S14: Since the remaining space of data space 01 and data space 02 is insufficient to accommodate D, D is placed in data space 03.
[0094] Step S15: Since the remaining space of data space 01 and data space 02 is insufficient to accommodate E, the remaining space of data space 03 can accommodate E, so E is placed in data space 03;
[0095] Step S16: Since the remaining space of data space 01, the remaining space of data space 02, and the remaining space of data space 03 are insufficient to accommodate F, E is placed in data space 04.
[0096] By traversing and reading the subsequences, the data length of each initial data can be calculated while reading, that is, the initial data can be placed in multiple data spaces simply and efficiently, and then the spliced data can be obtained based on the distribution of the initial data in the data space, thereby improving processing efficiency.
[0097] According to one aspect of the present disclosure, a data processing device is also provided. Figure 4 FIG. 4 shows a structural block diagram of a data processing device 400 according to an exemplary embodiment of the present disclosure. Figure 4 As shown, the apparatus 400 includes:
[0098] An acquisition unit 410 is configured to acquire a data sequence including a plurality of initial data of different lengths;
[0099] a splitting unit 420 configured to split the data sequence into a plurality of subsequences, wherein the amount of initial data included in each of the plurality of subsequences does not exceed a quantity threshold;
[0100] The first operating unit 430 is configured to perform a first operation on each subsequence of the plurality of subsequences to obtain at least one spliced data corresponding to each subsequence, wherein the first operating unit includes:
[0101] The first splicing subunit 431 is configured to, for each subsequence, determine, in response to determining that a first data set that satisfies a first condition exists in the subsequence, wherein, according to the first condition, a sum of lengths of a plurality of initial data in the first data set is not greater than a target length, determine, based on the first data set, spliced data having the target length;
[0102] a second splicing subunit 432 configured to, in response to determining that the subsequence further includes second data, splice the second data with padding bits to obtain spliced data having the target length; and
[0103] A third splicing subunit 433 is configured to, in response to determining that the first data set does not exist in the subsequence, splice each initial data in the subsequence with padding bits to obtain spliced data with the target length; and
[0104] The sending unit 440 is configured to send at least one spliced data corresponding to each subsequence to the processor based on the arrangement order of the multiple subsequences, so that the processor can use the memory space corresponding to the target length to perform data processing on the multiple spliced data in sequence.
[0105] According to some embodiments, the first data set in each subsequence is determined using a determination unit, and the determination unit includes: a first determination subunit, configured to determine the length of each initial data in the subsequence; and a second determination subunit, configured to determine whether the first data set exists in the subsequence based on the length of each initial data in the subsequence.
[0106] According to some embodiments, the first determining subunit is configured to: sequentially perform a read operation on each initial data in the subsequence, wherein the read operation includes: determining the length of each initial data when reading the initial data.
[0107] According to some embodiments, the second determination subunit includes: an initialization module, configured to initialize a data space sequence, wherein the number of data spaces in the data space sequence is not less than the number threshold, and the size of each data space is equal to the target length; and a second operation module, configured to sequentially perform a second operation on each initial data in the subsequence, the second operation module including: a determination submodule, configured to, for each initial data, in response to determining that there is at least one first data space in the multiple data spaces that satisfies a second condition, wherein, according to the second condition, the first data space is a non-empty data space and the remaining space size of the first data space is not less than the length of the initial data, determine a target data space from the at least one first data space; a first placement submodule, placing the initial data into the target data space; and a second placement submodule, in response to determining that the first data space does not exist in the data space sequence, placing the initial data into an empty data space in the data space sequence; and a first determination module, configured to determine whether the first data set exists in the subsequence based on the distribution of each initial data in the subsequence in the data space sequence.
[0108] According to some embodiments, the first determining submodule is configured to: determine a first data space having the largest remaining space among the at least one first data space as the target data space.
[0109] According to some embodiments, the second determination subunit includes: a reordering module, configured to reorder the subsequence based on the length of each initial data in the subsequence to obtain a rearranged subsequence; and a second determination module, configured to determine whether the first data set exists in the subsequence based on the first initial data and the last initial data in the rearranged subsequence.
[0110] According to some embodiments, the first splicing subunit is configured to: determine spliced data having the target length based on the first data set if the sum of lengths of multiple initial data in the first data set is not greater than a target length.
[0111] According to some embodiments, the initial data is text data, and the processor is configured to: sequentially input the multiple concatenated data into a language model based on deep learning, so that the language model can perform model inference based on the multiple concatenated data.
[0112] According to another aspect of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above-mentioned data processing method.
[0113] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is further provided, wherein the computer instructions are used to enable the computer to execute the above-mentioned data processing method.
[0114] According to another aspect of the present disclosure, a computer program product is further provided, comprising a computer program, wherein the computer program implements the above-mentioned data processing method when executed by a processor.
[0115] refer to Figure 5 , a block diagram of an electronic device 500 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0116] like Figure 5As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0117] Multiple components within device 500 are connected to I / O interface 505, including an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. Input unit 506 can be any device capable of inputting information into device 500. Input unit 506 can receive input numeric or character information and generate key signal input related to user settings and / or function control of the electronic device. It may include, but is not limited to, a mouse, keyboard, touch screen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 507 can be any device capable of presenting information and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. Storage unit 508 may include, but is not limited to, a magnetic disk or an optical disk. Communication unit 509 allows device 500 to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks. It may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and / or chipset, such as a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0118] The computing unit 501 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as the data processing method. For example, in some embodiments, the data processing method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the data processing method described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the data processing method by any other appropriate means (e.g., by means of firmware).
[0119] Various embodiments of the systems and techniques described above 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), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0120] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0121] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can 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 can 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.
[0122] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer 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 can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 acoustic input, voice input, or tactile input).
[0123] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0124] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0125] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0126] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but is only limited by the claims after authorization and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. In addition, the steps may be performed in an order different from that described in this disclosure. Further, the various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced by equivalent elements that appear after this disclosure.
Claims
1. A data processing method, comprising: Acquire a data sequence including a plurality of initial data of different lengths; Dividing the data sequence into a plurality of subsequences, wherein the amount of initial data included in each of the plurality of subsequences does not exceed a quantity threshold; Performing a first operation on each subsequence of the multiple subsequences to obtain at least one concatenated data corresponding to each subsequence, wherein the first operation on each subsequence includes: In response to determining that a first data set that satisfies a first condition exists in the subsequence, wherein, according to the first condition, a sum of lengths of multiple initial data in the first data set is not greater than a target length, determining, based on the first data set, concatenated data having the target length, comprising: in response to determining that the sum of lengths of multiple initial data in the first data set is less than the target length, concatenating the multiple initial data in the first data set and padding bits to obtain the concatenated data; In response to determining that the subsequence further includes second data, concatenating the second data with padding bits to obtain concatenated data having the target length; and In response to determining that the first data set does not exist in the subsequence, for each initial data in the subsequence, concatenate the initial data with padding bits to obtain concatenated data having the target length; and Based on the arrangement order of the multiple subsequences, at least one spliced data corresponding to each subsequence is sent to a processor, so that the processor can perform data processing on the multiple spliced data in sequence using a memory space corresponding to the target length.
2. The method of claim 1, wherein The first data set in each subsequence is determined as follows: determining the length of each initial data in the subsequence; and Based on the length of each initial data in the subsequence, it is determined whether the first data set exists in the subsequence.
3. The method according to claim 2, wherein: Determining the length of each initial data in the subsequence includes: A read operation is sequentially performed on each initial data in the subsequence, wherein the read operation includes: determining the length of each initial data when reading the initial data.
4. The method of claim 2, wherein: The determining, based on the length of each initial data in the subsequence, whether the first data set exists in the subsequence includes: Initializing a data space sequence, wherein the number of data spaces in the data space sequence is not less than the number threshold, and the size of each data space is equal to the target length; and The following second operation is performed sequentially for each initial data in the subsequence: In response to determining that there is at least one first data space among the plurality of data spaces that satisfies a second condition, wherein, according to the second condition, the first data space is a non-empty data space and a remaining space size of the first data space is not less than a length of the initial data, determining a target data space from the at least one first data space; placing the initial data into the target data space; and In response to determining that the first data space does not exist in the data space sequence, placing the initial data into an empty data space in the data space sequence; and Based on the distribution of each initial data in the subsequence in the data space sequence, it is determined whether the first data set exists in the subsequence.
5. The method according to claim 4, wherein: Determining the target data space from the at least one first data space includes: A first data space with the largest remaining space among the at least one first data space is determined as the target data space.
6. The method of claim 2, wherein: The determining, based on the length of each initial data in the subsequence, whether the first data set exists in the subsequence includes: reordering the subsequence based on the length of each initial data in the subsequence to obtain a reordered subsequence; and Based on the first initial data and the last initial data in the rearranged subsequence, it is determined whether the first data set exists in the subsequence.
7. The method according to any one of claims 1 to 6, wherein The initial data is text data, and the sequentially performing data processing on the plurality of spliced data includes: The plurality of concatenated data are sequentially input into a language model based on deep learning, so that the language model can perform model inference based on the plurality of concatenated data.
8. A data processing device comprising: an acquiring unit configured to acquire a data sequence including a plurality of initial data of different lengths; a splitting unit configured to split the data sequence into a plurality of subsequences, wherein the amount of initial data included in each of the plurality of subsequences does not exceed a quantity threshold; A first operating unit is configured to perform a first operation on each subsequence of the plurality of subsequences to obtain at least one spliced data corresponding to each subsequence, wherein the first operating unit includes: The first splicing subunit is configured to, for each subsequence, in response to determining that a first data set that satisfies a first condition exists in the subsequence, wherein, according to the first condition, a sum of lengths of multiple initial data in the first data set is not greater than a target length, determine, based on the first data set, spliced data having the target length, comprising: in response to determining that the sum of lengths of multiple initial data in the first data set is less than the target length, splicing the multiple initial data in the first data set and padding bits to obtain the spliced data; a second splicing subunit configured to, in response to determining that the subsequence further includes second data, splice the second data with padding bits to obtain spliced data having the target length; and a third splicing subunit configured to, in response to determining that the first data set does not exist in the subsequence, splice each initial data in the subsequence with padding bits to obtain spliced data having the target length; and The sending unit is configured to send at least one spliced data corresponding to each subsequence to a processor based on the arrangement order of the multiple subsequences, so that the processor can use the memory space corresponding to the target length to perform data processing on the multiple spliced data in sequence.
9. The device according to claim 8, wherein The first data set in each subsequence is determined by a determining unit, wherein the determining unit includes: A first determining subunit is configured to determine the length of each initial data in the subsequence; and The second determining subunit is configured to determine whether the first data set exists in the subsequence based on the length of each initial data in the subsequence.
10. The device according to claim 9, wherein The first determining subunit is configured to: A read operation is sequentially performed on each initial data in the subsequence, wherein the read operation includes: determining the length of each initial data when reading the initial data.
11. The device according to claim 9, wherein The second determining subunit includes: an initialization module configured to initialize a data space sequence, wherein the number of data spaces in the data space sequence is not less than the number threshold, and the size of each data space is equal to the target length; and The second operation module is configured to sequentially perform a second operation on each initial data in the subsequence, the second operation module comprising: a determining submodule configured to, for each initial data, determine a target data space from the at least one first data space in response to determining that there is at least one first data space in the plurality of data spaces that satisfies a second condition, wherein, according to the second condition, the first data space is a non-empty data space and a remaining space size of the first data space is not less than a length of the initial data; A first placement submodule places the initial data into the target data space; and a second placement submodule, in response to determining that the first data space does not exist in the data space sequence, placing the initial data into an empty data space in the data space sequence; and The first determination module is configured to determine whether the first data set exists in the subsequence based on the distribution of each initial data in the subsequence in the data space sequence.
12. The device according to claim 11, wherein The determining submodule is configured as follows: A first data space with the largest remaining space among the at least one first data space is determined as the target data space.
13. The apparatus of claim 9, wherein: The second determining subunit includes: a reordering module configured to reorder the subsequence based on the length of each initial data in the subsequence to obtain a reordered subsequence; and The second determining module is configured to determine whether the first data set exists in the rearranged subsequence based on the first initial data and the last initial data in the subsequence.
14. The device according to any one of claims 8 to 13, wherein: The initial data is text data, and the processor is configured to: The plurality of concatenated data are sequentially input into a language model based on deep learning, so that the language model can perform model inference based on the plurality of concatenated data.
15. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.
17. A computer program product comprising a computer program, wherein The computer program implements the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
An apparatus and method for performing a splice operation
GB201513497D0
Text category recognition method and apparatus, computer device, and medium
WO2023045184A1