Data processing method and device, equipment and medium

By dividing the data sequence into multiple subsequences and performing splicing operations for each subsequence, splicing data with the target length is formed, and memory fragmentation problems caused by fluctuations in memory occupancy in deep learning data processing are solved, and efficient data processing and stable hardware performance are achieved.

CN119621006AActive Publication Date: 2025-03-14BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411732744.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-14
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

In deep learning data processing, memory usage fluctuations due to differences in data lengths in different batches will result in fragmentation of memory allocation and affecting data processing efficiency.

Method used

By obtaining a data sequence including multiple initial data of different lengths, dividing it into multiple sub-sequences, each sub-sequence includes no more than a number threshold, a splicing operation is performed for each sub-sequence, forming splicing data with a target length, and sending it to the processor for data processing.

Benefits of technology

While improving data processing efficiency, local chaotic splicing reduces the impact on data distribution characteristics, reducing the hollow rate of splicing data, avoiding memory fragmentation, and ensuring the stability of hardware performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621006A_ABST
    Figure CN119621006A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, equipment and a medium, and relates to the technical field of artificial intelligence, in particular to the technical field of data processing and natural language processing. The implementation scheme is as follows: acquiring a data sequence comprising a plurality of initial data with different lengths; segmenting the data sequence into a plurality of subsequences; executing a first operation based on each sub-sequence to obtain spliced data with a target length; in response to determining that a first data set meeting a first condition exists in the sub-sequence, determining the spliced data based on the first data set; in response to determining that the sub-sequence further comprises the second data, splicing the second data with the filling bits to obtain spliced data; in response to determining that the first data set does not exist in the sub-sequence, splicing each piece of initial data in the sub-sequence with the filling bit to obtain spliced data; and sending the spliced data corresponding to each sub-sequence to a processor based on the arrangement sequence of the plurality of sub-sequences.
Need to check novelty before this filing date? Find Prior Art

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 is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0003] With the development of artificial intelligence technology, more and more applications based on artificial intelligence technology have achieved results far exceeding traditional algorithms. Deep learning is a data-intensive algorithm. In order to improve the utilization of hardware resources, multiple batches of data to be processed can be serially input into the processor so that the processor can execute the data processing process based on each batch of data in turn. In this case, the difference in the amount of data in different batches is bound to cause fluctuations in hardware performance parameters, such as changes in memory usage, which in turn causes fragmentation of memory allocation and affects data processing efficiency.

[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have 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: acquiring a data sequence including 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 concatenated 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 the 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 the 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 including 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 concatenated data corresponding to each subsequence, wherein the first operation unit comprises: a first concatenating 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 so that the at least one processor can 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, including 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 ensuring data processing accuracy while improving data processing efficiency.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0014] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an exemplary embodiment 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 showing a data processing process according to an exemplary embodiment of the present disclosure;

[0017] Figure 4 A structural block diagram of a data processing device according to an exemplary embodiment of the present disclosure is shown;

[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 is a description of exemplary embodiments of the present disclosure 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 recognized by those of ordinary skill 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, the description of well-known functions and structures is omitted in the following description.

[0020] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0021] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0022] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0023] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which 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 may 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 data processing method to be performed.

[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 may support any number of client devices.

[0028] Client devices 101, 102, 103, 104, 105 and / or 106 may include various categories of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various categories 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, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. The client device is capable of executing a variety of 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 may 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, 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, dedicated 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 above operating systems and 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, etc.

[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 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, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in 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 various 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 may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different categories. 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 categories 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 the application of various methods and apparatuses described in the present disclosure.

[0037] When it is necessary to process 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 into 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, it is possible to obtain spliced ​​data of equal length while avoiding data voids. However, this method will cause the data arrangement to be disordered, greatly changing the data distribution characteristics, which may cause a large deviation in the data processing results, affecting the accuracy of data processing.

[0039] Based on this, the present disclosure provides a data processing method, which divides the data sequence into multiple subsequences after receiving a data sequence composed of initial data of unequal lengths, attempts to perform splicing in each subsequence, and when there is a first data set that meets the splicing condition, multiple initial data in the set are spliced ​​into spliced ​​data with a target length, and the initial data that does not meet the splicing condition is spliced ​​using padding bits. In this case, the spliced ​​initial data is only out of order within the subsequence range, which has little impact on the overall sample distribution, that is, the accuracy of data processing is ensured while achieving data splicing and reducing the void rate of the final equal-length data.

[0040] Figure 2 FIG. 4 is a flow chart showing a data processing method according to an exemplary embodiment of the present disclosure. Figure 2 As shown, the method 200 includes:

[0041] Step S210, obtaining 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: performing the following first operation based on each subsequence of the multiple subsequences to obtain at least one spliced ​​data corresponding to each subsequence:

[0044] Step S231: in response to determining that there is a first data set in the subsequence that satisfies a first condition, wherein, according to the first condition, the sum of lengths of multiple initial data in the first data set is not greater than a target length, determining concatenated data having the target length based on the first data set;

[0045] Step S232, 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

[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 a padding bit to obtain concatenated data having the target length; and

[0047] Step S240: 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 by using a memory space corresponding to the target length.

[0048] By applying the above-mentioned data processing method 200, after receiving a data sequence consisting of multiple initial data of unequal lengths, the data sequence can be divided into multiple subsequences, and the first operation is performed in each subsequence to convert the initial data into spliced ​​data with a target length. Specifically, in the first operation, splicing can be attempted based on the first condition (i.e., data splicing condition), 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 filler 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 a 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 during data processing, and effectively improving data processing efficiency.

[0049] In some examples, in step S220, the data sequence may be segmented based on a quantity threshold so that the number of initial data included in each subsequence is as large 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 manually in advance based on experience. As described above, according to the data processing method 200 provided by the present disclosure, the data that can be spliced ​​is searched inside the subsequence, so the ordinal difference of 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 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 by 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, so as to ensure the accuracy of the data processing results.

[0050] In some examples, the processor in step S240 may also be a distributed reasoning system based on multiple processing cores, so that multiple processing cores can be used 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, which facilitates the management of parallel processing processes in the distributed system, 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 as much as possible to reduce the hole rate of spliced ​​data and improve 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 a subsequence based on multiple groups of initial data to increase the proportion of valid data bits in the spliced ​​data and reduce the data hole rate, thereby making more effective use of hardware resources and improving data processing efficiency.

[0053] In some examples, it is also possible to determine whether the first data set exists based on the length of part of the initial data in each subsequence. For example, the length of each initial data in the subsequence may be obtained in sequence until a preset number of first data sets can be determined therefrom, and then the preset number of first data sets are spliced, that is, the number of initial data to be spliced ​​in each subsequence can be limited, so as to avoid excessive changes in the distribution characteristics of the initial data sequence, thereby ensuring the accuracy of data processing.

[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 when reading the initial data. Thus, the length of the initial data can be calculated while reading the initial data, without having to perform other 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 in the subsequence may also be achieved by other means. For example, the initial data may carry explicit data length information, and the data length may be determined based on the explicit information. For another example, when the initial data is in array form, the length acquisition function may be used to acquire the array length, that is, to acquire the length of the initial data.

[0056] According to some embodiments, the 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 for each initial data in the subsequence: in response to determining that there is at least one first data space that satisfies the second condition in the multiple data spaces, 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 the 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 the 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. Thus, the initial data in the subsequence can be placed in the data space by traversal, and finally the combination splicing strategy of the initial data is determined based on the distribution of the initial data in each data space, so as to obtain the spliced ​​data more efficiently.

[0057] As mentioned above, in step S231-step S233, the initial data satisfying the splicing conditions are spliced ​​with each other, and the initial data not satisfying the splicing conditions are spliced ​​with the padding bits. In this case, by applying the above means, the data space can be used to record the splicing information of the initial data, that is, the initial data satisfying the splicing conditions are placed in the same data space, and the initial data not satisfying the splicing conditions are allowed to occupy a data space exclusively, thereby determining the combination splicing strategy of the initial data based on the distribution of the initial data in each data space, and thereby obtaining the spliced ​​data more efficiently.

[0058] As mentioned above, in some examples, the length of the initial data can be calculated while reading the initial data, so as 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, and then the second condition for detecting the first data space is determined based on the length information, so as to improve the efficiency of the second operation and more efficiently put 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 in the at least one first data space as the target data space. Thus, when traversing the initial data in the subsequence, the data space with the largest remaining space can be selected as the target data space of the current initial data, that is, data splicing based on a greedy strategy is implemented, that is, the proportion of valid data bits in the spliced ​​data is increased as much as possible, and the data hole rate caused by the filling bits is reduced, so as to make more full use of hardware resources and improve data processing efficiency.

[0060] The following is an example to illustrate the operation of processing the initial data based on the greedy strategy provided by the present disclosure to obtain the spliced ​​data:

[0061] In this example, the threshold value of the number of subsequences is 6. The following is an exemplary implementation of performing the first operation on 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, processing data 1 with a length of 60, at this time all data spaces are empty, so data 1 is placed in data space a, and the remaining space size of data space a is 20;

[0064] Step S3, processing 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 new data space b, and the remaining space of data space b is 40.

[0065] Step S4, processing data 3 with a length of 30, when comparing the maximum remaining space, the remaining space sizes of data spaces a and b are 20 and 40 respectively, and data space b can accommodate data 3, so data 3 is put into data space b, and the remaining space size of data space b is 10;

[0066] Step S5, processing data 4 with a length of 20, when comparing the maximum remaining space, the remaining space sizes of data spaces a and b are 20 and 10 respectively, and data space a can accommodate data 4, so data 4 is put into data space a, and the remaining space size of data space a is 0;

[0067] Step S6, processing data 5 with a length of 40, when comparing the maximum remaining space, the remaining space sizes of data spaces a and b are 0 and 10 respectively, which are insufficient to accommodate data 4, so data 5 is put into a new data space c, and the remaining space size of data space c is 40;

[0068] Step S7, processing 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.

[0070] In some examples, the operation of processing the initial data based on the greedy strategy to obtain the spliced ​​data can be implemented using the following steps:

[0071] Step S11, initializing 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 with a length of buffer_size, use the array to record the remaining space sizes of multiple sets, and the initial value of the remaining space size of the first set can be set to max_length, and the initial value of the remaining space size of the remaining sets can be set to a non-positive number, 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 capacity is buffer_size, so as 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, determining the length of the initial data. In some examples, the length of each initial data may be determined while being read in.

[0076] Step S16: Search the array for the value with the largest remaining space size, and then determine the set with the largest remaining space size (ie, the data space).

[0077] Step S17: When the length of the initial data currently being processed is smaller than the maximum remaining space found, the initial data is placed in the corresponding set with the largest remaining space.

[0078] Step S18: When the set with the largest remaining space is not enough to fill the initial data currently being processed, 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 the above steps S15 to S18 for each data, the operation of determining the target data space for placing the initial data is realized according to the length of the initial data and the remaining space size of the set. After all the initial data are traversed, data splicing can be performed based on the distribution of the initial data in each set (data space) to obtain spliced ​​data of equal length.

[0080] According to some embodiments, the 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 rearranged 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 rearranged subsequence. Thus, by reordering the subsequence according to the length of the initial data, it is possible to achieve sorting filling based on the sorting result, minimize the proportion of filling bits in the spliced ​​data, that is, reduce the data hole rate, and improve 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, splicing data can be obtained based on D1 and D4. When the sum of the lengths of D2 and D3 meets the first condition, splicing data can be obtained 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 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. Thus, the spliced ​​data can be obtained by padding with padding bits, and the length alignment of the spliced ​​data is achieved.

[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, data segments in the concatenated data corresponding to the original 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 sequentially input the multiple spliced ​​data into a language model based on deep learning, 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 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 hole 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 fine-tuning training or alignment training for a pre-trained language model. By using task data in a 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 a data processing process according to an exemplary embodiment of the present disclosure is shown, wherein a subsequence is obtained after segmenting an initial data sequence. 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 cause 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 combined to obtain the spliced ​​data based on the reordering result is shown. Figure 3B As shown in FIG. 1 , 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 in turn 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 mentioned above, the first operation based on reordering can minimize the hole rate of spliced ​​data, but it is necessary to reorder the full amount of initial data in the subsequence, that is, it includes an additional sorting operation, resulting in additional resource occupation, and to a greater extent, causing data disorder, changing the data distribution characteristics of the original data sequence. In actual application scenarios, the specific implementation method of the first operation can be determined according to 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 of 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, but the remaining space of data space 02 can accommodate C, C is placed in data space 02;

[0093] Step S14: Since the remaining space of data space 01 and the remaining space of data space 02 are insufficient to store D, D is stored in data space 03;

[0094] Step S15: Since the remaining space of data space 01 and the remaining space of data space 02 are 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 is 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 easily and efficiently placed in multiple data spaces, 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 device 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 segmentation unit 420 is configured to segment 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 operation unit 430 is configured to perform a first operation based on each subsequence of the multiple subsequences to obtain at least one spliced ​​data corresponding to each subsequence, wherein the first operation unit includes:

[0101] The first concatenation subunit 431 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, the sum of lengths of multiple initial data in the first data set is not greater than a target length, determine concatenated data having the target length based on the first data set;

[0102] A second concatenation subunit 432 is configured to, 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

[0103] A third concatenation subunit 433 is configured to, in response to determining that the first data set does not exist in the subsequence, concatenate each initial data in the subsequence with a padding bit to obtain concatenated data having 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: if the sum of lengths of multiple initial data in the first data set is not greater than a target length, determine splicing data having the target length based on the first data set.

[0111] According to some embodiments, the initial data is text data, and the processor is configured to: input the multiple concatenated data into a deep learning-based language model in sequence, so that the language model can perform model reasoning 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 so that the at least one processor can execute 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 also 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, including a computer program, wherein the computer program implements the above data processing method when executed by a processor.

[0115] refer to Figure 5 , a block diagram of an electronic device 500 that can be used 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, workbenches, 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. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. 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 in the device 500 are connected to the I / O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 can be any type of device that can input information to the device 500. The input unit 506 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 507 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 508 can include but is not limited to a disk, an optical disk. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a 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 may 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 running 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 data processing methods. For example, in some embodiments, the data processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).

[0119] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including 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 may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0121] 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.

[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 backend 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 frontend 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 backend components, middleware components, or frontend 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 the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0125] It should be understood that the various forms of 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 different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[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 only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present 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 based on each subsequence of the multiple subsequences to obtain at least one concatenated data corresponding to each subsequence, wherein the first operation for 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 a plurality of initial data in the first data set is not greater than a target length, determining concatenated data having the target length based on the first data set; 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 a padding bit 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 in the following manner: Determine 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 of claim 2, wherein: Determining the length of each initial data in the subsequence comprises: 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 according to claim 2 or 3, wherein: The determining, based on the length of each initial data in the subsequence, whether the first data set exists in the subsequence comprises: 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 that satisfies a second condition among the plurality of data spaces, 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 of claim 4, wherein: The determining of the target data space from the at least one first data space comprises: 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 comprises: 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 determining, based on the first data set, the spliced ​​data having the target length comprises: In response to determining that the sum of the lengths of the multiple initial data in the first data set is less than the target length, the multiple initial data in the first data set and padding bits are concatenated to obtain the concatenated data.

8. The method according to any one of claims 1 to 7, 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 reasoning based on the plurality of concatenated data.

9. A data processing device, comprising: an acquisition unit, configured to acquire a data sequence including a plurality of initial data of different lengths; a segmentation unit, configured to segment 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 operation unit is configured to perform a first operation based on each subsequence of the multiple subsequences to obtain at least one spliced ​​data corresponding to each subsequence, wherein the first operation unit includes: A first concatenation subunit 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, based on the first data set, determine concatenated data having the target length; a second concatenation subunit configured to, 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 a third concatenation subunit configured to, in response to determining that the first data set does not exist in the subsequence, concatenate each initial data in the subsequence with a padding bit to obtain concatenated data having the target length; and The sending unit 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.

10. The device of claim 9, wherein: The first data set in each subsequence is determined by a determination unit, and the determination 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.

11. The device of claim 10, wherein: The first determining subunit is configured as follows: 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.

12. The device according to claim 10 or 11, 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, and the second operation module includes: a determination 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 satisfying a second condition in the plurality of data spaces, 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.

13. The device of claim 12, wherein: The first 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.

14. The device of claim 10, 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 determination 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.

15. The device according to any one of claims 9 to 14, wherein: The first splicing subunit is configured as follows: In response to determining that the sum of the lengths of the multiple initial data in the first data set is less than the target length, the multiple initial data in the first data set and padding bits are concatenated to obtain the concatenated data.

16. The device according to any one of claims 9 to 15, 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 reasoning based on the plurality of concatenated data.

17. 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 8.

18. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-8.

19. A computer program product comprising a computer program, wherein: The computer program implements the method according to any one of claims 1 to 8 when executed by a processor.

Citation Information

Patent Citations

  • Image processing method and device, equipment and medium

    CN117196932A

  • Mask machine translation method and system, readable medium and equipment

    CN117764087A

  • Data processing method and device, equipment and storage medium

    CN118013967A

  • An apparatus and method for performing a splice operation

    GB201513497D0

  • Data stream generating device and its method and variable length encoded data stream generating device and its method and camera system

    JP2002237755A