Data processing methods, systems, electronic devices and media in model inference scenarios
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-17
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]本公开要解决的技术问题是为了克服现有技术中存在模型推理场景没有考虑敏感数据的处理,导致其传输的安全性等无法得到保障缺陷,目的在于提供一种模型推理场景中的数据处理方法、系统、电子设备及介质
[0056]本公开中,对于模型推理场景中所需传输的数据,考虑对于这些数据中的特定数据(如敏感数据)进行保护处理,具体是采用数据流的方式将待传输的目标数据写入预设缓冲器中的写入区域,基于敏感数据标识信息自动识别出该写入区域中的不同的敏感数据,然后自动生成每个敏感数据的敏感数据指针信息,以及表征不同的敏感数据的数据结构的结构体信息,即将同一写入区域中多块敏感数据的进行了合理、有序地关联,如此构造得到体现多块敏感数据的结构体信息的初始敏感数据链表,进而采用预先设置的第一预设数据处理算法对敏感数据进行处理,形成目标敏感数据链表,保证了后续对于所有敏感数据进行有序、高效且全面的加密等处理操作,以及有效保证主机端向设备端传输数据过程中,其中的敏感数据传输的安全性和完整性,极大程度上实现对敏感信息保护的及时性与可靠性,避免发生敏感信息的泄露的情况,从而保证了整个数据传输过程的安全与可靠。
Smart Images

Figure CN122578293A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data transmission technology, and in particular to a data processing method, system, electronic device, and medium in a model reasoning scenario. Background Technology
[0002] With the development of technology, data-centric digital technologies are gradually becoming a new driving force for economic development. New technologies such as artificial intelligence, cloud computing, blockchain, and industrial internet are all based on massive amounts of data, making the protection of data security crucial.
[0003] However, existing model inference scenarios generally do not consider the processing of specific data (such as sensitive data), which makes it impossible to guarantee the security of the transmission of such sensitive data. Summary of the Invention
[0004] The technical problem to be solved by this disclosure is to overcome the shortcomings of existing technologies that do not consider the processing of sensitive data in model inference scenarios, resulting in the inability to guarantee the security of its transmission. The purpose is to provide a data processing method, system, electronic device and medium in model inference scenarios.
[0005] This disclosure solves the above-mentioned technical problems through the following technical solution:
[0006] In a first aspect, this disclosure provides a data processing method for a model inference scenario, the data processing method being applied to a host device in the model inference scenario, the data processing method comprising:
[0007] The target data to be transmitted in the model inference scenario is written into at least one write area in a preset buffer in the form of a data stream.
[0008] Based on the sensitive data identification information in the data stream, different sensitive data and corresponding sensitive data pointer information in the writing area are obtained, and structure information representing the data structure of different sensitive data is generated to generate an initial sensitive data linked list.
[0009] A first preset data processing algorithm matching the algorithm identifier information in the writing area is obtained, and based on the first preset data processing algorithm and the initial sensitive data list, different sensitive data in the writing area are encrypted respectively to generate a target sensitive data list, which is then transmitted to the device in the model inference scenario.
[0010] Optionally, the preset buffer includes a ring buffer, and each write area in the ring buffer includes address information of the data stream being written;
[0011] The step of generating the initial sensitive data linked list includes:
[0012] Based on the address information of the write area, the sensitive data pointer information and the structure information corresponding to different sensitive data in the write area, and the algorithm identifier information, the initial sensitive data linked list is generated.
[0013] Optionally, the first preset data processing algorithm includes a combination of a preset encryption algorithm and a preset hash algorithm;
[0014] The step of obtaining a first preset data processing algorithm that matches the algorithm identifier information in the writing area, and encrypting different sensitive data in the writing area based on the first preset data processing algorithm and the initial sensitive data linked list to generate a target sensitive data linked list, includes:
[0015] Based on the sensitive data pointer information corresponding to different sensitive data in the initial sensitive data linked list, and the structure information between different sensitive data, the matching preset encryption algorithm is used to encrypt different sensitive data sequentially, and the matching preset hash algorithm is used to calculate the reference hash value of different sensitive data, until the encryption processing of all sensitive data in the writing area is completed, so as to obtain the target sensitive data linked list.
[0016] And / or,
[0017] The structure information includes the offset and / or data size of the adjacent sensitive data in the write area;
[0018] And / or,
[0019] The model reasoning scenario describes a producer-consumer model applied to AI reasoning.
[0020] A second aspect of this disclosure provides a data processing method for a model inference scenario, the data processing method being applied to a device in the model inference scenario, the data processing method comprising:
[0021] In response to the host in the model inference scenario writing target data into at least one write area in a preset buffer in the form of a data stream, the target sensitive data linked list corresponding to the write area is obtained.
[0022] The target sensitive data linked list is obtained based on a first preset data processing algorithm that matches the algorithm identifier information in the writing area and an initial sensitive data linked list. The initial sensitive data linked list is generated by the host based on the sensitive data identifier information in the data stream, obtaining different sensitive data in the writing area and the corresponding sensitive data pointer information, as well as the structure information representing the data structure of the different sensitive data.
[0023] Based on the target sensitive data linked list, obtain algorithm identification information, and determine the second preset data processing algorithm according to the first preset data processing algorithm matched by the algorithm identification information;
[0024] The encrypted sensitive data in the target sensitive data chain is decrypted using the second preset data processing algorithm to obtain the plaintext information of the different sensitive data corresponding to the writing area.
[0025] Optionally, the first preset data processing algorithm includes a combination algorithm of a preset encryption algorithm and a preset hash algorithm, and the second preset data processing algorithm includes a combination algorithm of a preset decryption algorithm that matches the preset encryption algorithm and a preset hash algorithm.
[0026] The step of decrypting the encrypted sensitive data in the target sensitive data linked list using the second preset data processing algorithm to obtain the plaintext information of the different sensitive data corresponding to the writing area includes:
[0027] Based on the target sensitive data linked list, obtain the reference hash value corresponding to the sensitive data in the current write area;
[0028] The actual hash value corresponding to the sensitive data in the current write area is calculated using the preset hash algorithm.
[0029] In response to the fact that the actual hash value is consistent with the reference hash value, it is determined that the sensitive data in the target sensitive data chain is complete, and the encrypted information of the sensitive data in the target sensitive data chain is decrypted using the preset decryption algorithm to obtain the plaintext information of the different sensitive data corresponding to the writing area;
[0030] In response to the discrepancy between the actual hash value and the reference hash value, it is determined that the sensitive data in the target sensitive data list has been tampered with, an abnormal alert message is generated and sent to the host.
[0031] Optionally, the data processing method further includes:
[0032] The root key security control method is used to update the decryption key of the preset decryption algorithm used to decrypt encrypted sensitive data;
[0033] And / or,
[0034] The plaintext information of the sensitive data obtained by decryption in each of the written areas is pulled down to the data queue in the idle state;
[0035] And / or,
[0036] In response to the existence of plaintext information that overflows the original data queue, the data queue is expanded, and the overflowing plaintext information is pulled down to the expanded data queue;
[0037] And / or,
[0038] The structure information includes the offset and / or data size of the adjacent sensitive data in the write area;
[0039] And / or,
[0040] The model reasoning scenario corresponds to the producer-consumer model of AI (artificial intelligence) reasoning.
[0041] A third aspect of this disclosure provides a data processing system for a model inference scenario, the data processing system being applied to a host terminal in the model inference scenario, the data processing system comprising:
[0042] The data writing module is used to write the target data to be transmitted in the model inference scenario into at least one writing area in a preset buffer in the form of a data stream.
[0043] Structure information generation module; based on the sensitive data identification information in the data stream, obtain different sensitive data and corresponding sensitive data pointer information in the writing area, and generate structure information representing the data structure of different sensitive data;
[0044] The first linked list generation module is used to generate the initial sensitive data linked list;
[0045] The target linked list generation module is used to encrypt different sensitive data in the writing area based on the first preset data processing algorithm and the initial sensitive data linked list, so as to generate a target sensitive data linked list and transmit it to the device in the model inference scenario.
[0046] In a fourth aspect, this disclosure provides a data processing system for a model inference scenario, the data processing system being applied to a device in the model inference scenario, the data processing system comprising:
[0047] The target linked list acquisition module is used to acquire the target sensitive data linked list corresponding to the writing area in response to the host writing target data in the model inference scenario as a data stream to at least one writing area in a preset buffer.
[0048] The target sensitive data linked list is obtained based on a first preset data processing algorithm that matches the algorithm identifier information in the writing area and an initial sensitive data linked list. The initial sensitive data linked list is generated by the host based on the sensitive data identifier information in the data stream, obtaining different sensitive data in the writing area and the corresponding sensitive data pointer information, as well as the structure information representing the data structure of the different sensitive data.
[0049] The processing algorithm determination module is used to obtain algorithm identification information based on the target sensitive data linked list, and determine a second preset data processing algorithm according to the first preset data processing algorithm matched by the algorithm identification information.
[0050] The decryption processing module allows the user to use the second preset data processing algorithm to decrypt the encrypted sensitive data in the target sensitive data chain to obtain the plaintext information of the different sensitive data corresponding to the writing area.
[0051] A fifth aspect of this disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and for running on the processor, wherein the processor executes the computer program to implement a data processing method in a model reasoning scenario as described in the first aspect; or, a data processing method in a model reasoning scenario as described in the second aspect.
[0052] A sixth aspect of this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a data processing method in a model reasoning scenario as described in the first aspect; or, a data processing method in a model reasoning scenario as described in the second aspect.
[0053] A seventh aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements a data processing method in a model reasoning scenario as described in the first aspect; or, a data processing method in a model reasoning scenario as described in the second aspect.
[0054] Based on common knowledge in the field, the above-mentioned preferred conditions can be combined arbitrarily to obtain various preferred embodiments of this disclosure.
[0055] The positive and progressive effects of this disclosure are as follows:
[0056] In this disclosure, for the data to be transmitted in the model inference scenario, specific data (such as sensitive data) within this data is protected. Specifically, the target data to be transmitted is written into the write area of a preset buffer using a data stream method. Based on the sensitive data identification information, different sensitive data in the write area are automatically identified. Then, sensitive data pointer information for each sensitive data and structure information representing the data structure of different sensitive data are automatically generated. In other words, multiple blocks of sensitive data in the same write area are reasonably and orderly associated, thus constructing an initial sensitive data linked list that reflects the structure information of multiple blocks of sensitive data. Then, a pre-set first preset data processing algorithm is used to process the sensitive data to form the target sensitive data linked list. This ensures that subsequent encryption and other processing operations are performed on all sensitive data in an orderly, efficient and comprehensive manner, and effectively ensures the security and integrity of sensitive data transmission during the data transmission process from the host to the device. This greatly improves the timeliness and reliability of sensitive information protection, avoids the leakage of sensitive information, and thus ensures the security and reliability of the entire data transmission process.
[0057] In addition, the processing scheme in this embodiment integrates cryptography with the AI interaction model, supports hardware cryptography accelerators, and adds security mechanisms without affecting computing power, thereby further ensuring the data processing efficiency and security in the model inference scenario. Attached Figure Description
[0058] Figure 1 A schematic diagram of the model framework in a model inference scenario;
[0059] Figure 2 This is a first flowchart of the data processing method in the model reasoning scenario of Embodiment 1 of this disclosure;
[0060] Figure 3 This is a second flowchart of the data processing method in the model reasoning scenario of Embodiment 1 of this disclosure;
[0061] Figure 4 This is a schematic diagram of the sensitive data linked list in Embodiment 1 of this disclosure;
[0062] Figure 5 This is a first flowchart of the data processing method in the model reasoning scenario of Embodiment 2 of this disclosure;
[0063] Figure 6 This is a second flowchart of the data processing method in the model reasoning scenario of Embodiment 2 of this disclosure;
[0064] Figure 7 This is a schematic diagram of the data processing system in the model reasoning scenario of Embodiment 3 of this disclosure;
[0065] Figure 8 This is a schematic diagram of the data processing system in the model reasoning scenario of Embodiment 4 of this disclosure;
[0066] Figure 9 This is a schematic diagram of the structure of the electronic device according to Embodiment 5 of this disclosure. Detailed Implementation
[0067] The present disclosure is further illustrated below by way of embodiments, but the present disclosure is not limited to the scope of the embodiments described herein.
[0068] The prefixes such as "first" and "second" used in this disclosure are merely for distinguishing different descriptive objects and do not limit the position, order, priority, quantity, or content of the described objects. The use of ordinal numbers and other prefixes used to distinguish descriptive objects in this disclosure does not constitute a limitation on the described objects. The description of the described objects is given in the claims or the context of the embodiments, and should not be construed as an unnecessary limitation. Furthermore, in the description of this embodiment, unless otherwise stated, "multiple" means two or more.
[0069] In this embodiment of the disclosure, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information comply with relevant laws and regulations and do not violate public order and good morals.
[0070] Example 1
[0071] The data processing method in the model inference scenario of this embodiment is applied to the host side of the model inference scenario.
[0072] Among them, such as Figure 1 As shown, the model inference scenario is oriented towards a host-to-device model architecture, including a producer-consumer model for AI inference, suitable for data security protection in fields such as cloud inference, industrial control computers, and connected vehicles; for example, it is used to protect sensitive data such as video and images during transmission in specific scenarios, effectively ensuring the secure transmission and processing of sensitive data during data transmission, as well as ensuring the integrity of sensitive data transmission. Specifically:
[0073] like Figure 2 As shown, the data processing method in the model inference scenario of this embodiment includes:
[0074] S101. Write the target data to be transmitted in the model inference scenario into at least one write area in the preset buffer in the form of a data stream.
[0075] In one feasible scheme, the preset buffer includes a ring buffer, into which the target data to be transmitted on the host side is inserted in the form of a data stream; specifically, the ring buffer has different ring entries (write areas).
[0076] S102. Based on the sensitive data identification information in the data stream, obtain different sensitive data and corresponding sensitive data pointer information in the writing area, and generate structure information representing the data structure of different sensitive data;
[0077] In one feasible approach, the structure information includes offsets of adjacent sensitive data in the write region, data sizes, etc.
[0078] In this process, the host (producer) pre-sets filtering conditions based on requirements to determine which dimensions of data are sensitive data in the scenario. Before actually transmitting the target data, it needs to be processed to identify and mark the sensitive data within the target data, and the corresponding sensitive data identification information is recorded. This embodiment does not limit the implementation process of how to identify sensitive data in the target data, as long as an existing feasible method is used.
[0079] Of course, the host (producer) can adjust the pre-set filtering conditions according to actual needs to extract all sensitive information in a more flexible, personalized and convenient way, thereby meeting the needs of scenarios with higher processing requirements.
[0080] S103. Generate the initial sensitive data linked list;
[0081] S104. Obtain a first preset data processing algorithm that matches the algorithm identifier information in the writing area, and based on the first preset data processing algorithm and the initial sensitive data list, encrypt different sensitive data in the writing area to generate a target sensitive data list, and transmit it to the device in the model inference scenario.
[0082] In this embodiment, for the data to be transmitted in the model inference scenario, protection processing is considered for specific data (such as sensitive data) within this data. Specifically, the target data to be transmitted is written into the write area of a preset buffer using a data stream method. Based on the sensitive data identification information, different sensitive data in the write area are automatically identified, and then sensitive data pointer information for each sensitive data and structure information representing the data structure of different sensitive data are automatically generated. That is, multiple blocks of sensitive data in the same write area are reasonably and orderly associated, thus constructing an initial sensitive data linked list that reflects the structure information of multiple blocks of sensitive data. Then, a pre-set first preset data processing algorithm is used to process the sensitive data to form the target sensitive data linked list. This ensures that subsequent encryption and other processing operations are performed on all sensitive data in an orderly, efficient and comprehensive manner, and effectively ensures the security and integrity of sensitive data transmission during the data transmission process from the host to the device. This greatly realizes the timeliness and reliability of sensitive information protection, avoids the leakage of sensitive information, and thus ensures the security and reliability of the entire data transmission process.
[0083] In addition, the processing scheme in this embodiment integrates cryptography with the AI interaction model, supports hardware cryptography accelerators, and adds security mechanisms without affecting computing power, thereby further ensuring the data processing efficiency and security in the model inference scenario.
[0084] In one feasible solution, the default buffer is a ring buffer, and each write region in the ring buffer includes the address information of the data stream being written.
[0085] like Figure 3 As shown, step S103 includes:
[0086] S1031. Based on the address information of the write area, the sensitive data pointer information and structure information corresponding to different sensitive data in the write area, and the algorithm identification information, generate an initial sensitive data linked list.
[0087] like Figure 4As shown in the example, any write region Px includes, but is not limited to: write pointer, read pointer, stream buffer addr, stream size, algorithm flag, sensitive pointer, offset, size, hash value, and next pointer.
[0088] In this scheme, for each block of sensitive data in any write area, a linked list is constructed based on the sensitive data identifier information, sensitive data pointer information, and the structure information (offset, data size, etc.) of other sensitive data to represent the data structure of multiple blocks of sensitive data in the same write area. This ensures that the sensitive data are reasonably and orderly associated, and that subsequent encryption and other processing operations are carried out in an orderly, efficient and comprehensive manner for all sensitive data.
[0089] In one feasible solution, the first preset data processing algorithm includes a combination of a preset encryption algorithm and a preset hash algorithm;
[0090] The preset encryption algorithms include, but are not limited to, RSA and AES encryption algorithms, and the preset hash algorithms include, but are not limited to, SHA256 and MAC hash algorithms.
[0091] In actual use, the host computer is mainly configured with the corresponding first preset data processing algorithm according to actual needs. Of course, the algorithm combination (or algorithm suite) can be dynamically specified, such as AES+SHA256, RSA+SHA256, etc.
[0092] like Figure 3 As shown, step S104 includes:
[0093] S1041. Based on the sensitive data pointer information corresponding to different sensitive data in the initial sensitive data linked list, and the structure information between different sensitive data, a matching preset encryption algorithm is used to encrypt different sensitive data in sequence, and a matching preset hash algorithm is used to calculate the reference hash value of different sensitive data, until the encryption processing of all sensitive data in the writing area is completed, so as to obtain the target sensitive data linked list.
[0094] In this embodiment, when encrypting sensitive data, not only is encryption processing aligned with the encryption algorithm, but a hash algorithm is also used to process the encrypted information to ensure the integrity of the encrypted information. This effectively ensures the security and integrity of sensitive data transmission in the target data of the model inference scenario.
[0095] Example 2
[0096] The data processing method in the model inference scenario of this embodiment is applied to the device side in the model inference scenario.
[0097] Among them, such as Figure 1 As shown, the model inference scenario is geared towards a host-to-device model architecture, including a producer-consumer model for AI inference, suitable for data security protection in fields such as cloud inference, industrial control computers, and connected vehicles; for example, it is used to protect sensitive data such as video and images during transmission in specific scenarios, effectively ensuring the secure transmission and processing of sensitive data during data transmission, as well as ensuring the integrity of sensitive data transmission. Specifically:
[0098] like Figure 5 As shown, the data processing method in the model inference scenario of this embodiment includes:
[0099] S201. In response to the host in the model inference scenario, the target data is written into at least one write area in the preset buffer in the form of a data stream, and the target sensitive data linked list corresponding to the write area is obtained.
[0100] Among them, the target sensitive data linked list is obtained based on the first preset data processing algorithm and the initial sensitive data linked list, which are matched with the algorithm identifier information in the writing area. The initial sensitive data linked list is generated by the host based on the sensitive data identifier information in the data stream, obtaining different sensitive data in the writing area and the corresponding sensitive data pointer information, as well as the structure information representing the data structure of different sensitive data.
[0101] Preset buffers include, but are not limited to, ring buffers.
[0102] Specifically, when a new data stream is inserted into the ring buffer, a ring update interrupt is triggered on the device. The device then retrieves the target sensitive data list of the new write area from the ring buffer via PCIe and parses it.
[0103] The structure information includes the offset of adjacent sensitive data in the write area, the data size, etc.
[0104] S202. Obtain algorithm identification information based on the target sensitive data linked list, and determine the second preset data processing algorithm according to the first preset data processing algorithm matched by the algorithm identification information.
[0105] S203. The second preset data processing algorithm is used to decrypt the encrypted sensitive data in the target sensitive data chain to obtain the plaintext information of the different sensitive data corresponding to the written area.
[0106] In this embodiment, once the host inserts the data to be transmitted into the ring buffer in the form of a data stream, the device will automatically be triggered to actively obtain the target sensitive data linked list in the corresponding write area for analysis to determine whether the sensitive data meets the preset conditions (such as whether it has been tampered with). If the sensitive data is confirmed to be complete, the corresponding sensitive data is decrypted to obtain the plaintext of different sensitive data in the same write area, and added to the data stream to obtain a data stream containing the plaintext of the sensitive data in the same write area. This completes the secure and complete transmission of the target data containing the sensitive data from the host to the device, effectively ensuring the security and reliability of data transmission in the inference model scenario.
[0107] In one feasible scheme, the first preset data processing algorithm includes a combination algorithm of a preset encryption algorithm and a preset hash algorithm, and the second preset data processing algorithm includes a combination algorithm of a preset decryption algorithm that matches the preset encryption algorithm and a preset hash algorithm.
[0108] like Figure 6 As shown, step S203 includes:
[0109] S2031. Based on the target sensitive data linked list, obtain the reference hash value corresponding to the sensitive data in the current write area;
[0110] S2032. The actual hash value corresponding to the sensitive data in the current write area is calculated using a preset hash algorithm;
[0111] S2033. In response to the consistency between the actual hash value and the reference hash value, it is determined that the sensitive data in the target sensitive data chain is complete, and a preset decryption algorithm is used to decrypt the encrypted information of the sensitive data in the target sensitive data chain to obtain the plaintext information of the different sensitive data corresponding to the written area.
[0112] In response to the discrepancy between the actual hash value and the reference hash value, it is determined that sensitive data in the target sensitive data list has been tampered with, and an abnormal alert message is generated and sent to the host.
[0113] In this embodiment, on the device side, the first preset data processing algorithm is obtained by parsing the target sensitive data linked list, thereby determining the hash algorithm and decryption algorithm (such as AES+SHA256) to be used in the decryption stage, and these algorithms are used to initialize the algorithm engine on the device side; the actual hash value A of each encrypted sensitive data in the target sensitive data linked list is calculated using the parsed hash algorithm, and it is compared with the corresponding reference hash value B. If the two are consistent, it is determined that the current sensitive data has not been tampered with and is complete. Then, the corresponding decryption algorithm is used to decrypt the encrypted sensitive data to obtain the plaintext information of the corresponding sensitive data; different sensitive data encrypted in the same writing area are subjected to integrity judgment and decryption respectively, and the corresponding plaintext information is added to the same data stream respectively until the processing of the entire target sensitive data linked list is completed to obtain the data stream corresponding to the same writing area;
[0114] If the actual hash value A corresponding to a certain encrypted sensitive data is inconsistent with the reference hash value B, it is determined that the encrypted sensitive data has been tampered with. At this time, the corresponding abnormal alert information will be automatically generated and fed back to the host so that the host can be aware of the situation and relevant personnel can intervene and handle it in a timely manner.
[0115] In one feasible embodiment, the data processing method further includes:
[0116] The Root key (a type of key) security control method is used to update the decryption key of the preset decryption algorithm used to decrypt encrypted sensitive data;
[0117] In this embodiment, the decryption key is dynamically updated through the Root key security control method, instead of using a fixed decryption key, which further improves the security and reliability of the sensitive data processing process.
[0118] In one feasible embodiment, the data processing method further includes:
[0119] The plaintext information of the sensitive data obtained by decryption in each write area is pulled down to the data queue in the idle state;
[0120] If plaintext information overflows the original data queue, the data queue is expanded, and the overflowing plaintext information is pulled down to the expanded data queue.
[0121] In this embodiment, after processing the entire target sensitive data linked list, the data stream corresponding to the same write area is pulled down to the idle data queue SQ; if data overflow occurs, the original data queue SQ is expanded, and the overflowed plaintext information is pulled down to the expanded data queue to ensure timely and reliable storage of the processed data, which facilitates subsequent stable calls and processing.
[0122] The following example illustrates the working principle of the data processing scheme in the model inference scenario of this embodiment:
[0123] Combination Figure 1 The overall framework of the model inference scenario includes the host side and the device side, which communicate with each other through PCIe;
[0124] (1) Data processing process on the host side
[0125] In actual model inference scenarios, the upper-layer software on the host side inserts the target data to be transmitted (corresponding to the command stream) into one or more Px in the ring buffer in the form of a data stream; Figure 1 P0, P1, ..., Pn in the text represent a single write region ring entry;
[0126] The write area Px of the inserted data stream contains the following information: streambuffer addr (pointer to the data stream), sensitive pointer (pointer to sensitive data), writepointer (write pointer), read pointer (read pointer), stream size (data stream size), algorithm flag (algorithm flag), offset of adjacent sensitive data, size of adjacent sensitive data, and hash value (reference hash value).
[0127] Based on the above information, the host constructs a linked list that can represent the data structure relationship between multiple blocks of sensitive data in the same write area;
[0128] The AES+SHA256 algorithm combination is used to process each sensitive data in the same write area to ensure data security and integrity, and the processed target sensitive data linked list is transmitted to the device.
[0129] (2) Data processing process at the device end
[0130] Once the host inserts the data to be transmitted into the ring buffer in the form of a data stream, it will automatically trigger the current update operation of the device terminal and actively obtain the target sensitive data list in the corresponding write area through PCIe for analysis.
[0131] The algorithm identifier information is obtained based on the target sensitive data linked list, and the corresponding encryption algorithm and hash algorithm (such as AES+SHA256) are determined in the decryption stage.
[0132] Obtain the reference hash value corresponding to the sensitive data in the current writing area, and calculate the actual hash value corresponding to the sensitive data in the current writing area using a preset hash algorithm (such as SHA256). When the actual hash value is consistent with the reference hash value, it is determined that the corresponding sensitive data is complete and has not been tampered with. Then, the corresponding decryption algorithm is used to decrypt the data to obtain the plaintext information corresponding to the sensitive data, and add it to the same data stream. This process continues until all sensitive data in the target sensitive data list has been processed. The obtained data is then pulled down to the idle SQ, and the overflow portion is pulled down to the extended SQ.
[0133] In this process, several command packets correspond to the same data stream. A command dispatcher distributes different command packets to matching processing units. Each processing unit processes the received command packets in sequence and sends back an ACK character after execution to confirm the normal transmission of the received data packets.
[0134] In addition, the reference hash value corresponding to the sensitive data in the current writing area is obtained, and the actual hash value corresponding to the sensitive data in the current writing area is calculated using a preset hash algorithm (such as SHA256). If the actual hash value is inconsistent with the reference hash value, it is determined that the corresponding sensitive data is incomplete and has been tampered with, and this abnormal situation is reported to the host. In this case, the encrypted sensitive data will no longer be decrypted.
[0135] Example 3
[0136] The data processing system in the model inference scenario of this embodiment is applied to the host side of the model inference scenario. The data processing system includes, but is not limited to, AI chips and GPUs (graphics processing units).
[0137] Among them, such as Figure 1As shown, the model inference scenario is geared towards a host-to-device model architecture, including a producer-consumer model for AI inference, suitable for data security protection in fields such as cloud inference, industrial control computers, and connected vehicles; for example, it is used to protect sensitive data such as video and images during transmission in specific scenarios, effectively ensuring the secure transmission and processing of sensitive data during data transmission, as well as ensuring the integrity of sensitive data transmission. Specifically:
[0138] like Figure 7 As shown, the data processing system in this embodiment includes:
[0139] Data writing module 1 is used to write the target data to be transmitted in the model inference scenario into at least one writing area in a preset buffer in the form of a data stream.
[0140] In one feasible scheme, the preset buffer includes a ring buffer, into which the target data to be transmitted on the host side is inserted in the form of a data stream; specifically, the ring buffer has different ring entries (write areas).
[0141] Structure information generation module 2: Based on the sensitive data identification information in the data stream, it obtains different sensitive data and corresponding sensitive data pointer information in the writing area, and generates structure information representing the data structure of different sensitive data;
[0142] In one feasible approach, the structure information includes offsets of adjacent sensitive data in the write region, data sizes, etc.
[0143] The first linked list generation module 3 is used to generate the initial sensitive data linked list;
[0144] The target linked list generation module 4 is used to encrypt different sensitive data in the writing area based on the first preset data processing algorithm and the initial sensitive data linked list, so as to generate the target sensitive data linked list and transmit it to the device in the model inference scenario.
[0145] In one feasible solution, the default buffer is a ring buffer, and each write region in the ring buffer includes the address information of the data stream being written.
[0146] The first linked list generation module 3 is used to generate an initial sensitive data linked list based on the address information of the write area, the sensitive data pointer information and structure information corresponding to different sensitive data in the write area, and the algorithm identification information.
[0147] In one feasible solution, the first preset data processing algorithm includes a combination of a preset encryption algorithm and a preset hash algorithm;
[0148] The target linked list generation module 4 is used to encrypt different sensitive data sequentially based on the sensitive data pointer information corresponding to different sensitive data in the initial sensitive data linked list and the structure information between different sensitive data, using a matching preset encryption algorithm, and to calculate the reference hash value of different sensitive data using a matching preset hash algorithm, until the encryption processing of all sensitive data in the writing area is completed, so as to obtain the target sensitive data linked list.
[0149] For the system embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs.
[0150] Example 4
[0151] The data processing system in this embodiment, used in the model inference scenario, is applied to the device side of the model inference scenario. This data processing system includes, but is not limited to, AI chips and GPUs.
[0152] Among them, such as Figure 1 As shown, the model inference scenario is geared towards a host-to-device model architecture, including a producer-consumer model for AI inference, suitable for data security protection in fields such as cloud inference, industrial control computers, and connected vehicles; for example, it is used to protect sensitive data such as video and images during transmission in specific scenarios, effectively ensuring the secure transmission and processing of sensitive data during data transmission, as well as ensuring the integrity of sensitive data transmission. Specifically:
[0153] like Figure 8 As shown, the data processing system in this embodiment includes:
[0154] The target linked list acquisition module 5 is used to respond to the host in the model inference scenario writing target data into at least one write area in a preset buffer in the form of a data stream, and to acquire the target sensitive data linked list corresponding to the write area.
[0155] Among them, the target sensitive data linked list is obtained based on the first preset data processing algorithm and the initial sensitive data linked list, which are matched with the algorithm identifier information in the writing area. The initial sensitive data linked list is generated by the host based on the sensitive data identifier information in the data stream, obtaining different sensitive data in the writing area and the corresponding sensitive data pointer information, as well as the structure information representing the data structure of different sensitive data.
[0156] Preset buffers include, but are not limited to, ring buffers.
[0157] Specifically, when a new data stream is inserted into the ring buffer, a ring update interrupt is triggered on the device. The device then retrieves the target sensitive data list of the new write area from the ring buffer via PCIe and parses it.
[0158] The structure information includes the offset of adjacent sensitive data in the write area, the data size, etc.
[0159] The processing algorithm determination module 6 is used to obtain algorithm identification information based on the target sensitive data linked list, and determine the second preset data processing algorithm according to the first preset data processing algorithm matched by the algorithm identification information.
[0160] In the decryption processing module 7, the user uses the second preset data processing algorithm to decrypt the encrypted sensitive data in the target sensitive data chain to obtain the plaintext information of the different sensitive data corresponding to the written area.
[0161] In one feasible scheme, the first preset data processing algorithm includes a combination algorithm of a preset encryption algorithm and a preset hash algorithm, and the second preset data processing algorithm includes a combination algorithm of a preset decryption algorithm that matches the preset encryption algorithm and a preset hash algorithm.
[0162] The decryption processing module 7 is also used to obtain the reference hash value corresponding to the sensitive data in the current writing area based on the target sensitive data linked list; and to calculate the actual hash value corresponding to the sensitive data in the current writing area using a preset hash algorithm.
[0163] In response to the consistency between the actual hash value and the reference hash value, it is determined that the sensitive data in the target sensitive data chain is complete, and a preset decryption algorithm is used to decrypt the encrypted information of the sensitive data in the target sensitive data chain to obtain the plaintext information of the different sensitive data corresponding to the writing area;
[0164] In response to the discrepancy between the actual hash value and the reference hash value, it is determined that sensitive data in the target sensitive data list has been tampered with, and an abnormal alert message is generated and sent to the host.
[0165] In one feasible embodiment, the data processing system further includes:
[0166] Update module 8 is used to update the decryption key of the preset decryption algorithm used to decrypt encrypted sensitive data using the Root key security control method.
[0167] In one feasible embodiment, the data processing system further includes:
[0168] Storage module 9 is used to pull the plaintext information of the sensitive data decrypted in each write area down to the idle data queue;
[0169] Storage module 9 is also used to expand the data queue and pull the overflowing plaintext information down to the expanded data queue in response to the existence of plaintext information that overflows the original data queue;
[0170] For the system embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs.
[0171] In addition, the data processing system in the model reasoning scenario of Embodiments 3 and 4 can be the same data processing system in the same model reasoning scenario, or it can be two independent and interactive data processing systems. The specific deployment or adjustment can be made according to the actual scenario requirements.
[0172] Example 5
[0173] Figure 9 This is a schematic diagram of the structure of an electronic device according to an example embodiment of the present disclosure. The electronic device includes a memory, a processor, and a computer program stored in the memory and used to run on the processor. When the processor executes the computer program, it implements the data processing method in the model reasoning scenario described in any of the above embodiments. Figure 9 The electronic device 90 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0174] like Figure 9 As shown, the electronic device 90 can be manifested as a general-purpose computing device, such as a server device. The components of the electronic device 90 may include, but are not limited to: at least one processor 91, at least one memory 92, and a bus 93 connecting different system components (including memory 92 and processor 91).
[0175] Bus 93 includes a data bus, an address bus, and a control bus.
[0176] The memory 92 may include volatile memory, such as random access memory (RAM) 921 and / or cache memory 922, and may further include read-only memory (ROM) 923.
[0177] The memory 92 may also include a program tool 925 (or utility) having a set (at least one) program module 924, such program module 924 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0178] The processor 91 executes various functional applications and data processing by running computer programs stored in the memory 92, such as the data processing method in the model reasoning scenario provided in any of the above embodiments.
[0179] Electronic device 90 can also communicate with one or more external devices 94 (e.g., keyboard, pointing device, etc.). This communication can be performed through input / output (I / O) interface 95. Furthermore, electronic device 90 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public network, such as the Internet) via network adapter 96. As shown, network adapter 96 communicates with other modules of electronic device 90 via bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.
[0180] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0181] Example 8
[0182] This disclosure also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the data processing method in the model reasoning scenario provided in any of the above embodiments.
[0183] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.
[0184] Example 9
[0185] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method in the model reasoning scenario described above.
[0186] The program code for executing the computer program product of this disclosure can be written in any combination of one or more programming languages, and the program code can be executed entirely on a user device, partially on a user device, as a stand-alone software package, partially on a user device and partially on a remote device, or entirely on a remote device.
[0187] While specific embodiments of this disclosure have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of this disclosure is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of this disclosure, but all such changes and modifications fall within the scope of protection of this disclosure.
Claims
1. A data processing method in a model reasoning scenario, characterized in that, The data processing method is applied to the host side in the model inference scenario, and the data processing method includes: The target data to be transmitted in the model inference scenario is written into at least one write area in a preset buffer in the form of a data stream. Based on the sensitive data identification information in the data stream, different sensitive data and corresponding sensitive data pointer information in the writing area are obtained, and structure information representing the data structure of different sensitive data is generated to generate an initial sensitive data linked list. A first preset data processing algorithm matching the algorithm identifier information in the writing area is obtained, and based on the first preset data processing algorithm and the initial sensitive data list, different sensitive data in the writing area are encrypted respectively to generate a target sensitive data list, which is then transmitted to the device in the model inference scenario.
2. The data processing method in the model reasoning scenario as described in claim 1, characterized in that, The preset buffer includes a ring buffer, and each write area in the ring buffer includes address information of the data stream being written. The step of generating the initial sensitive data linked list includes: Based on the address information of the write area, the sensitive data pointer information and the structure information corresponding to different sensitive data in the write area, and the algorithm identifier information, the initial sensitive data linked list is generated.
3. The data processing method in the model reasoning scenario as described in claim 1 or 2, characterized in that, The first preset data processing algorithm includes a combination of a preset encryption algorithm and a preset hash algorithm; The step of obtaining a first preset data processing algorithm that matches the algorithm identifier information in the writing area, and encrypting different sensitive data in the writing area based on the first preset data processing algorithm and the initial sensitive data linked list to generate a target sensitive data linked list, includes: Based on the sensitive data pointer information corresponding to different sensitive data in the initial sensitive data linked list, and the structure information between different sensitive data, the matching preset encryption algorithm is used to encrypt different sensitive data sequentially, and the matching preset hash algorithm is used to calculate the reference hash value of different sensitive data, until the encryption processing of all sensitive data in the writing area is completed, so as to obtain the target sensitive data linked list. And / or, The structure information includes the offset and / or data size of the adjacent sensitive data in the write area; And / or, The model reasoning scenario describes a producer-consumer model applied to AI reasoning.
4. A data processing method in a model reasoning scenario, characterized in that, The data processing method is applied to the device in the model inference scenario, and the data processing method includes: In response to the host in the model inference scenario writing target data into at least one write area in a preset buffer in the form of a data stream, the target sensitive data linked list corresponding to the write area is obtained. The target sensitive data linked list is obtained based on a first preset data processing algorithm that matches the algorithm identifier information in the writing area and an initial sensitive data linked list. The initial sensitive data linked list is generated by the host based on the sensitive data identifier information in the data stream, obtaining different sensitive data in the writing area and the corresponding sensitive data pointer information, as well as the structure information representing the data structure of the different sensitive data. Based on the target sensitive data linked list, obtain algorithm identification information, and determine the second preset data processing algorithm according to the first preset data processing algorithm matched by the algorithm identification information; The encrypted sensitive data in the target sensitive data chain is decrypted using the second preset data processing algorithm to obtain the plaintext information of the different sensitive data corresponding to the writing area.
5. The data processing method in the model reasoning scenario as described in claim 4, characterized in that, The first preset data processing algorithm includes a combination algorithm of a preset encryption algorithm and a preset hash algorithm; the second preset data processing algorithm includes a combination algorithm of a preset decryption algorithm that matches the preset encryption algorithm and a preset hash algorithm. The step of decrypting the encrypted sensitive data in the target sensitive data linked list using the second preset data processing algorithm to obtain the plaintext information of the different sensitive data corresponding to the writing area includes: Based on the target sensitive data linked list, obtain the reference hash value corresponding to the sensitive data in the current write area; The actual hash value corresponding to the sensitive data in the current write area is calculated using the preset hash algorithm. In response to the fact that the actual hash value is consistent with the reference hash value, it is determined that the sensitive data in the target sensitive data chain is complete, and the encrypted information of the sensitive data in the target sensitive data chain is decrypted using the preset decryption algorithm to obtain the plaintext information of the different sensitive data corresponding to the writing area; In response to the discrepancy between the actual hash value and the reference hash value, it is determined that the sensitive data in the target sensitive data list has been tampered with, an abnormal alert message is generated and sent to the host.
6. The data processing method in the model reasoning scenario as described in claim 4, characterized in that, The data processing method further includes: The root key security control method is used to update the decryption key of the preset decryption algorithm used to decrypt encrypted sensitive data; And / or, The plaintext information of the sensitive data obtained by decryption in each of the written areas is pulled down to the data queue in the idle state; And / or, In response to the existence of plaintext information that overflows the original data queue, the data queue is expanded, and the overflowing plaintext information is pulled down to the expanded data queue; And / or, The structure information includes the offset and / or data size of the adjacent sensitive data in the write area; And / or, The model inference scenario corresponds to the producer-consumer model of AI inference.
7. A data processing system for model reasoning scenarios, characterized in that, The data processing system is applied to the host side in the model inference scenario, and the data processing system includes: The data writing module is used to write the target data to be transmitted in the model inference scenario into at least one writing area in a preset buffer in the form of a data stream. Structure information generation module; based on the sensitive data identification information in the data stream, obtain different sensitive data and corresponding sensitive data pointer information in the writing area, and generate structure information representing the data structure of different sensitive data; The first linked list generation module is used to generate the initial sensitive data linked list; The target linked list generation module is used to obtain a first preset data processing algorithm that matches the algorithm identification information in the writing area, and based on the first preset data processing algorithm and the initial sensitive data linked list, to encrypt different sensitive data in the writing area to generate a target sensitive data linked list, and transmit it to the device in the model inference scenario.
8. A data processing system for model reasoning scenarios, characterized in that, The data processing system is applied to the device in the model inference scenario, and the data processing system includes: The target linked list acquisition module is used to acquire the target sensitive data linked list corresponding to the writing area in response to the host writing target data in the model inference scenario as a data stream to at least one writing area in a preset buffer. The target sensitive data linked list is obtained based on a first preset data processing algorithm that matches the algorithm identifier information in the writing area and an initial sensitive data linked list. The initial sensitive data linked list is generated by the host based on the sensitive data identifier information in the data stream, obtaining different sensitive data in the writing area and the corresponding sensitive data pointer information, as well as the structure information representing the data structure of the different sensitive data. The processing algorithm determination module is used to obtain algorithm identification information based on the target sensitive data linked list, and determine a second preset data processing algorithm according to the first preset data processing algorithm matched by the algorithm identification information. The decryption processing module allows the user to use the second preset data processing algorithm to decrypt the encrypted sensitive data in the target sensitive data chain to obtain the plaintext information of the different sensitive data corresponding to the writing area.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and for running on the processor, characterized in that, When the processor executes the computer program, it implements the data processing method in the model reasoning scenario as described in any one of claims 1 to 3; or, the data processing method in the model reasoning scenario as described in any one of claims 4 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the data processing method in the model reasoning scenario as described in any one of claims 1 to 3; or, the data processing method in the model reasoning scenario as described in any one of claims 4 to 6.