Data processing method, device, electronic device and readable storage medium

By obtaining initial data from the hardware storage device in the Android system and mapping it to physical memory after serialization, the problems of slow traditional data reading and writing speed and low security are solved, and more efficient and secure data processing is achieved.

CN119781835BActive Publication Date: 2025-09-16BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411639083.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-09-16
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

Traditional Android system applications have slow data reading and writing performance and low security, making it difficult to meet the needs of rapid development and expansion.

Method used

By switching from user mode to kernel mode after receiving a data processing request, obtaining initial data from the hardware storage device, serializing it and mapping it to physical memory, the application program directly reads and processes the target data in the physical memory, reducing the data copy process from kernel space to user space.

Benefits of technology

It improves data processing speed and efficiency, reduces physical memory resource usage, and improves data processing accuracy and security, especially the reading and writing performance of core data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781835B_ABST
    Figure CN119781835B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data processing method, device, electronic device and readable storage medium, which relate to the fields of artificial intelligence technology such as big data and cloud services. Among them, the data processing method includes: after receiving a data processing request sent by an application, switching from user mode to kernel mode, and obtaining initial data corresponding to the data processing request from a hardware storage device; in response to determining that the initial data meets the preset requirements, serializing the initial data to obtain target data; mapping the target data to physical memory, and switching from kernel mode to user mode, so that the application reads the target data from the physical memory and processes it. The present disclosure can improve the speed and efficiency of applications in processing data, reduce the resource occupation of physical memory, and improve data mapping and the accuracy of applications in processing data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to artificial intelligence technologies such as cloud services and big data. A data processing method, device, electronic device, and readable storage medium are provided. Background Art

[0002] With the rapid development of mobile internet and the widespread adoption of smart devices, Android-based applications are becoming increasingly diverse. As the number of users continues to grow and businesses expand, data access performance for Android-based applications has become a key challenge. Traditional data access methods suffer from slow speeds and low security. Summary of the Invention

[0003] According to a first aspect of the present disclosure, a data processing method is provided, comprising: after receiving a data processing request sent by an application, switching from user mode to kernel mode, and obtaining initial data corresponding to the data processing request from a hardware storage device; in response to determining that the initial data meets preset requirements, serializing the initial data to obtain target data; mapping the target data to physical memory, and switching from kernel mode to user mode, so that the application reads the target data from the physical memory and processes it.

[0004] According to a second aspect of the present disclosure, a data processing device is provided, comprising: an acquisition unit for switching from a user state to a kernel state after receiving a data processing request sent by an application, and acquiring initial data corresponding to the data processing request from a hardware storage device; a first processing unit for serializing the initial data in response to determining that the initial data meets preset requirements to obtain target data; a mapping unit for mapping the target data to a physical memory, and switching from the kernel state to the user state, so that the application reads the target data from the physical memory and processes it.

[0005] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described above.

[0006] According to a fourth 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 method as described above.

[0007] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method described above when executed by a processor.

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

[0009] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0010] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0011] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;

[0012] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;

[0013] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;

[0014] Figure 5 It is a block diagram of an electronic device used to implement the data processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0015] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, and various details of the embodiments of the present disclosure are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and mechanisms are omitted in the following description.

[0016] Figure 1 Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the data processing method of this embodiment specifically includes the following steps:

[0017] S101, after receiving a data processing request sent by an application, switching from user mode to kernel mode, and obtaining initial data corresponding to the data processing request from a hardware storage device;

[0018] S102: In response to determining that the initial data meets the preset requirements, serialize the initial data to obtain target data;

[0019] S103: Map the target data to the physical memory, and switch from kernel mode to user mode, so that the application program reads the target data from the physical memory and processes it.

[0020] The data processing method of this embodiment is executed by the terminal device or the operating system of the terminal device. On the one hand, by mapping the target data to the physical memory of the terminal device, the application can directly access the physical memory to read and write the target data, avoiding the need to execute the complex process of copying the target data from the kernel space to the user space, which can improve the speed and efficiency of the application in processing data. On the other hand, only when it is determined that the initial data obtained from the hardware storage device meets the preset requirements will the operations of serializing the initial data and mapping the target data to the physical memory be executed, which can reduce the resource occupation of the physical memory, improve data mapping and the accuracy of the application in processing data.

[0021] In this embodiment, the terminal device includes a smart phone, tablet, laptop, desktop, etc.; the operating system of the terminal device is the Android system; the hardware storage device of the terminal device includes a hard disk or disk (laptop or desktop), flash memory or external storage card (smart phone or tablet), etc.

[0022] In this embodiment, the data processing request sent by the application is a request to read or write data in the hardware storage device or the file where the data is located; the application can use standard file operation functions to send the data processing request to the terminal device or the operating system.

[0023] In this embodiment, user mode refers to the state of an application running in user space, and kernel mode refers to the state of an operating system kernel running in kernel space. Under normal circumstances, user mode applications cannot directly access resources located in the hardware storage device, and the terminal device or operating system needs to switch to kernel mode to obtain corresponding data from the hardware storage device through kernel space.

[0024] In order to successfully obtain the corresponding data from the hardware storage device, this embodiment executes S101 and switches the user state to the kernel state after receiving the data processing request sent by the application, thereby obtaining the initial data corresponding to the data processing request from the hardware storage device through the kernel state after switching.

[0025] When executing S101 in this embodiment, the received data processing request includes identification information of the data to be processed, which may be data type information, address information of the file where the data is located, etc.; based on the data type information or address information, this embodiment can obtain corresponding data from the hardware storage device, such as obtaining device attribute data of the terminal device (such as the model and manufacturer of the terminal device), or user attribute data of the terminal device (the acquisition of user attribute data has been previously authorized by the user, that is, the user is aware that the application will obtain attribute data related to it for processing).

[0026] It is understandable that since the terminal device may have multiple applications installed, there may be situations where multiple applications read and write the same data at the same time; in order to ensure the timing and uniqueness of data processing, this embodiment can also adopt a file locking method to lock the initial data corresponding to the data processing request in the current hardware storage device, and unlock it after completing the acquisition of the initial data corresponding to the current application, so that other applications can continue to acquire the same initial data.

[0027] In this embodiment, after executing S101 to obtain initial data corresponding to the data processing request from the hardware storage device, executing S102 to serialize the initial data in response to determining that the initial data meets the preset requirements to obtain target data.

[0028] In this embodiment, when determining whether the initial data meets the preset requirements during S102 , the following implementation method may be adopted: obtaining a data type of the initial data; and when determining that the obtained data type is a preset data type, determining that the initial data meets the preset requirements.

[0029] In this embodiment, the preset data type can be a core data type such as a device attribute data type, a user attribute data type, etc.; that is, when this embodiment determines that the initial data obtained belongs to core data such as device data or user data, it performs serialization processing and physical memory mapping, which can reduce the data size of the target data, reduce the resource consumption of physical memory, and thereby improve the performance of the application when reading and writing core data.

[0030] In addition, when executing S102 and determining whether the initial data meets the preset requirements, this embodiment may adopt the following implementation method: obtaining the data size of the initial data; and determining that the initial data meets the preset requirements when determining that the obtained data size is greater than a preset threshold.

[0031] That is to say, when this embodiment determines that the initial data is large, it converts the initial data into target data through serialization processing, which can reduce the data size of the target data, reduce the resource consumption of physical memory, and thus improve the performance of the application when reading and writing larger data.

[0032] When executing S102 in this embodiment, if it is determined that the initial data does not meet the preset requirements, there is no need to perform serialization processing and subsequent physical memory mapping. The existing method of first loading the initial data into the kernel space and then copying the initial data from the kernel space to the user space can be adopted.

[0033] When executing S102 in this embodiment, the initial data may be serialized in a binary serialization manner, thereby converting the initial data into target data in a binary format, so as to further reduce the data size of the target data.

[0034] After executing S102 to obtain the target data, this embodiment executes S103 to map the target data to the physical memory and switches from the kernel state to the user state, so that the application program reads the target data from the physical memory and processes it.

[0035] In this embodiment, when executing S103 to map the target data to the physical memory, the implementation method that can be adopted is: obtaining the data size of the target data; creating a target mapping area in the physical memory according to the obtained data size; and mapping the target data to the created target mapping area.

[0036] After executing S103 to map the target data to the physical memory, this embodiment can switch from kernel mode to user mode, so that the application can access the physical memory, read the target data from the target mapping area, and then perform read processing or write processing on the read target data.

[0037] After completing the creation of the target mapping area, this embodiment can establish a correspondence between the identification information in the data processing request and the target mapping area, so that the application can determine the target mapping area in the physical memory based on the identification information based on the correspondence, and then accurately obtain the target data that needs to be processed.

[0038] After executing S103 to map the target data to the physical memory and switching from the kernel state to the user state, this embodiment may further include the following contents: in response to determining that the application program accesses the target mapping area in the physical memory, the target data in the target mapping area is deserialized to obtain initial data, so that the application program processes the obtained initial data.

[0039] Since the physical memory includes the target data and the hardware storage device includes the initial data, this embodiment can also determine whether to obtain the initial data from the hardware storage device or directly obtain the target data from the physical memory by judging whether the CRC (Cyclic Redundancy Check) value of the data has changed.

[0040] Compare the CRC value of the initial data corresponding to the target data in the physical memory with the CRC value of the initial data in the hardware storage device. If it is determined that the CRC value of the data has changed, it indicates that the initial data has been modified, and the hardware storage device stores the latest initial data. The initial data needs to be obtained from the hardware storage device; if the CRC value of the data has not changed, it indicates that the data has not been modified, and the target data can be directly obtained through the physical memory.

[0041] In addition, since the target data located in the physical memory can be read and written by multiple threads of the same application, this implementation can use the volatile keyword to ensure that the target data processed by different threads of the same application is consistent; and use the synchronized keyword to ensure that only one thread among multiple threads can execute a method or code block in the data at the same time.

[0042] Figure 2 Schematic diagram of the second embodiment of the present disclosure. Figure 2 As shown in , this embodiment, when executing S102 "serializing the initial data to obtain target data", may include the following:

[0043] S201, serializing the initial data to obtain data to be encrypted;

[0044] S202: Encrypt the data to be encrypted using a secret key to obtain encrypted data;

[0045] S203: Store the secret key in the encrypted data to obtain the target data.

[0046] That is to say, this embodiment combines serialization processing and data encryption to obtain target data based on the initial data, so that while reducing the data size of the target data, it can also improve the security of the target data. When the initial data to be read and written by the application is core data, it effectively ensures that the core data will not be tampered with before the application reads and writes it.

[0047] When executing S201 , this embodiment may serialize the initial data using a binary serialization method to obtain data to be encrypted in a binary format. This embodiment may also use other serialization processing methods.

[0048] In this embodiment, when executing S202 , a key for encrypting data may be obtained in a random generation manner. In this embodiment, the number of keys for encrypting data may be a preset number, such as 5.

[0049] In addition, when executing S202 , this embodiment may also obtain a preset key to encrypt the data to be encrypted, thereby obtaining encrypted data.

[0050] When executing S203, this embodiment can obtain the target data by storing the secret key in a preset position in the encrypted data; in order to further improve security, when executing S203, this embodiment can also obtain the target data by storing the secret key in a random position in the encrypted data.

[0051] For example, if the number of keys is 5, when executing S203, this embodiment can store the 5 keys at the 1st, 3rd, 5th, 7th and 9th positions from the end of the encrypted data, or store the 5 keys at the 2nd, 4th, 6th, 8th and 10th positions from the beginning of the encrypted data, or store the 5 keys at the 2nd, 4th and 1st, 3rd and 7th positions from the end of the encrypted data.

[0052] After executing S203 to store the key in the encrypted data, this embodiment can also generate key location information based on the location information of the key in the encrypted data, and then send the generated key location information to the server; the key location information can also be directly stored locally on the terminal device.

[0053] When executing S203, this embodiment can first obtain the danger level of the terminal device (for example, match the current terminal device with a known gray market device. If the match is successful, obtain a high danger level as the danger level of the current terminal device). Then, when it is determined that the obtained danger level is a preset level (the preset level is a high danger level), the key location information is sent to the server side, so that the server side stores the key location information; if the danger level is not the preset level, the key location information is stored locally on the terminal device.

[0054] In this embodiment, the danger level of the terminal device is used to reflect whether the terminal device is a gray market device; if the danger level is high, it indicates that the terminal device is very likely to be a gray market device, and there is a risk that the terminal device will illegally use the target data mapped in the physical memory. It is necessary to store the key location information on the server side to ensure that the target data will not be decrypted without the user's knowledge; if the danger level is low, it indicates that the terminal device is very likely not to be a gray market device.

[0055] After obtaining the target data in an encrypted manner, this embodiment may further include the following: in response to determining that the application accesses the physical memory (or the target mapping area in the physical memory), obtaining key location information, and the application's access to the target data in the physical memory is usually performed with the user's knowledge; extracting the key from the target data based on the obtained key location information; using the extracted key to decrypt the target data to obtain decrypted data; deserializing the obtained decrypted data to obtain initial data, so that the application can process the obtained initial data.

[0056] In this embodiment, the key location information can be obtained from a location based on the danger level of the terminal device. If the danger level is a preset level (for example, the danger level is high-risk unbinding, indicating that the current terminal device is more likely to be a gray market device), the key location information is obtained from the server side. Otherwise, the key location information is obtained from the local terminal device. By storing the key location information on the server side, the security of the key location information can be improved, so that even if the danger level of the terminal device is high, the terminal device will not illegally use the target data after decrypting it after obtaining the key location information.

[0057] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure. Figure 3 : A schematic diagram of data processing in this embodiment is shown in the figure: the hardware storage device (such as a hard disk) of the terminal device stores the core data to be processed by the application; after the terminal device obtains the core data from the hardware storage device through the kernel space, it obtains the core data from the hardware storage device by, for example, using DMA (Direct Memory Access) copying, and maps the obtained core data to the physical memory of the terminal device through memory mapping; the application accesses the physical memory through the user space, and then reads and writes the core data stored in the physical memory, so that the application reads and writes the core data like accessing the memory, reducing the copy process of the core data from the kernel space to the user space, and improving the read and write performance of the core data.

[0058] In addition, when mapping the core data in the kernel space to the physical memory, this embodiment can further serialize the core data (for example, binary serialization) and encrypt the core data after serialization, thereby further improving the security of the core data mapped to the physical memory.

[0059] Correspondingly, when the application in this embodiment reads and writes the core data in the physical memory through the user space, the terminal device can also decrypt the core data located in the physical memory, and then deserialize it after decryption to obtain the original core data, so that the application can read and write the original core data.

[0060] Figure 4 Schematic diagram of the fourth embodiment of the present disclosure. Figure 4 As shown, the data processing device 400 of this embodiment is located in a terminal device and includes:

[0061] The acquisition unit 401 is configured to, after receiving a data processing request sent by an application, switch from a user state to a kernel state and acquire initial data corresponding to the data processing request from a hardware storage device;

[0062] A first processing unit 402 is configured to, in response to determining that the initial data meets a preset requirement, perform serialization processing on the initial data to obtain target data;

[0063] The mapping unit 403 is configured to map the target data to the physical memory and switch from the kernel state to the user state, so that the application program reads the target data from the physical memory and processes the target data.

[0064] In order to successfully obtain the corresponding data from the hardware storage device, the acquisition unit 401 in this embodiment will switch the user state to the kernel state after receiving the data processing request sent by the application, thereby obtaining the initial data corresponding to the data processing request from the hardware storage device through the kernel state after switching.

[0065] The data processing request received by the acquisition unit 401 includes identification information of the data to be processed, which may be data type information, address information of the file where the data is located, etc.; based on the data type information or address information, this embodiment can obtain corresponding data from the hardware storage device, such as obtaining the device attribute data of the terminal device (such as the model and manufacturer of the terminal device, etc.), or the user attribute data of the terminal device (the acquisition of the user attribute data has been previously authorized by the user, that is, the user knows that the application will obtain the attribute data related to it for processing).

[0066] It is understandable that since the terminal device may have multiple applications installed, there may be situations where multiple applications read and write the same data at the same time; in order to ensure the timing and uniqueness of data processing, this embodiment can also adopt a file locking method to lock the initial data corresponding to the data processing request in the current hardware storage device, and unlock it after completing the acquisition of the initial data corresponding to the current application, so that other applications can continue to acquire the same initial data.

[0067] In this embodiment, after the acquisition unit 401 acquires the initial data corresponding to the data processing request from the hardware storage device, the first processing unit 402 serializes the initial data in response to determining that the initial data meets the preset requirements to obtain the target data.

[0068] When determining that the initial data meets the preset requirement, the first processing unit 402 may implement the following method: obtaining a data type of the initial data; and when determining that the obtained data type is a preset data type, determining that the initial data meets the preset requirement.

[0069] In this embodiment, the preset data type can be a core data type such as a device attribute data type, a user attribute data type, etc.; that is, when this embodiment determines that the initial data obtained belongs to core data such as device data or user data, it performs serialization processing and physical memory mapping, which can reduce the data size of the target data, reduce the resource consumption of physical memory, and thereby improve the performance of the application when reading and writing core data.

[0070] In addition, when determining that the initial data meets the preset requirements, the first processing unit 402 may adopt the following implementation method: obtain the data size of the initial data; and when determining that the obtained data size is greater than a preset threshold, determine that the initial data meets the preset requirements.

[0071] That is to say, when this embodiment determines that the initial data is large, it converts the initial data into target data through serialization processing, which can reduce the data size of the target data, reduce the resource consumption of physical memory, and thus improve the performance of the application when reading and writing larger data.

[0072] If the first processing unit 402 determines that the initial data does not meet the preset requirements, there is no need to perform serialization processing and subsequent physical memory mapping. The existing method of first loading the initial data into the kernel space and then copying the initial data from the kernel space to the user space can be adopted.

[0073] The first processing unit 402 may perform serialization processing on the initial data in a binary serialization manner, thereby converting the initial data into target data in a binary format, so as to further reduce the data size of the target data.

[0074] When the first processing unit 402 serializes the initial data to obtain the target data, the following may also be included: serializing the initial data to obtain the data to be encrypted; encrypting the data to be encrypted using the secret key to obtain the encrypted data; and storing the secret key in the encrypted data to obtain the target data.

[0075] That is to say, the first processing unit 402 combines serialization processing and data encryption to obtain target data based on the initial data, so that while reducing the data size of the target data, it can also improve the security of the target data. When the initial data to be read and written by the application is core data, it can effectively ensure that the core data will not be tampered with before the application reads and writes.

[0076] The first processing unit 402 can obtain the key for encrypting data by randomly generating the key; the first processing unit 402 can also obtain the preset key to encrypt the data to be encrypted, thereby obtaining the encrypted data.

[0077] The first processing unit 402 may obtain the target data by storing the secret key in a preset position in the encrypted data; to further improve security, the first processing unit 402 may also obtain the target data by storing the secret key in a random position in the encrypted data.

[0078] After storing the key in the encrypted data, the first processing unit 402 can also generate key location information based on the location information of the key in the encrypted data, and then send the generated key location information to the server; it can also directly store the key location information locally on the terminal device.

[0079] The first processing unit 402 can first obtain the danger level of the terminal device, and then, if it is determined that the obtained danger level is a preset level, send the key location information to the server side, so that the server side stores the key location information; if the danger level is not the preset level, the key location information is stored locally on the terminal device.

[0080] In this embodiment, after the first processing unit 402 obtains the target data, the mapping unit 403 maps the target data to the physical memory and switches from the kernel state to the user state, so that the application reads the target data from the physical memory and processes it.

[0081] When mapping target data to physical memory, the mapping unit 403 may implement the following methods: obtaining the data size of the target data; creating a target mapping area in the physical memory according to the obtained data size; and mapping the target data to the created target mapping area.

[0082] After mapping the target data to the physical memory, the mapping unit 403 can switch from kernel mode to user mode, so that the application can access the physical memory, read the target data from the target mapping area, and then perform read processing or write processing on the read target data.

[0083] After completing the creation of the target mapping area, this embodiment can establish a correspondence between the identification information in the data processing request and the target mapping area, so that the application can determine the target mapping area in the physical memory based on the identification information based on the correspondence, and then accurately obtain the target data that needs to be processed.

[0084] After mapping the target data to the physical memory and switching from the kernel state to the user state, the mapping unit 403 may also include the following contents: in response to determining that the application accesses the target mapping area in the physical memory, deserializing the target data in the target mapping area to obtain initial data, so that the application processes the obtained initial data.

[0085] The data processing device 400 of this embodiment may also include a second processing unit 404, which is used to perform the following: in response to determining that the application accesses physical memory (or a target mapping area in the physical memory), obtain key location information; extract the key from the target data based on the obtained key location information; use the extracted key to decrypt the target data to obtain decrypted data; deserialize the obtained decrypted data to obtain initial data, so that the application processes the obtained initial data.

[0086] The second processing unit 404 can determine where to obtain the key location information based on the danger level of the terminal device. If the danger level is a preset level (for example, the danger level is high, indicating that the current terminal device is more likely to be a gray market device), the key location information is obtained from the server side; otherwise, the key location information is obtained from the local terminal device.

[0087] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0088] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0089] like Figure 5, is a block diagram of an electronic device according to a data processing method according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may 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 claimed herein.

[0090] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0091] Various components in device 500 are connected to I / O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, optical disk, etc.; and a communication unit 509, such as a network card, modem, wireless communication transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0092] The computing unit 501 may be a variety of general and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as data processing methods. For example, in some embodiments, the data processing method may be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 508.

[0093] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the data processing method described above 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).

[0094] Various embodiments of the systems and techniques described 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), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0095] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0096] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0097] 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).

[0098] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0099] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. The client-server relationship is established by computer programs running on the respective computers and establishing a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service system that addresses the management difficulties and poor business scalability of traditional physical hosts and VPS services ("Virtual Private Servers," or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.

[0100] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0101] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A data processing method, comprising: After receiving a data processing request sent by an application, switching from user mode to kernel mode, obtaining initial data corresponding to the data processing request from a hardware storage device; In response to determining that the initial data meets the preset requirements, serializing the initial data to obtain target data; The target data is mapped to the physical memory, and the kernel state is switched to the user state, so that the application program reads the target data from the physical memory and processes it.

2. The method according to claim 1, wherein Determining that the initial data meets the preset requirements includes: Acquire the data type of the initial data; When it is determined that the data type is a preset data type, it is determined that the initial data meets a preset requirement.

3. The method according to claim 1, wherein Determining that the initial data meets the preset requirements includes: Acquire the data size of the initial data; When it is determined that the data size is greater than a preset threshold, it is determined that the initial data meets a preset requirement.

4. The method according to claim 1, wherein The serialization processing of the initial data to obtain the target data includes: Serializing the initial data to obtain data to be encrypted; Encrypting the data to be encrypted using a secret key to obtain encrypted data; The secret key is stored in the encrypted data to obtain the target data.

5. The method according to claim 1, wherein Mapping the target data to the physical memory comprises: Acquire the data size of the target data; Creating a target mapping area in the physical memory according to the data size; The target data is mapped to the target mapping area.

6. The method according to claim 4, further comprising: In response to determining that the application accesses the physical memory, obtaining key location information; extracting a secret key from the target data according to the secret key location information; Decrypting the target data using the secret key to obtain decrypted data; The decrypted data is deserialized to obtain initial data, so that the application program processes the obtained initial data.

7. The method according to claim 6, wherein: The obtaining of key location information includes: Get the danger level of the terminal device; In response to determining that the danger level is a preset level, the key location information is obtained from a server.

8. A data processing device comprising: an acquiring unit, configured to, after receiving a data processing request sent by an application, switch from a user state to a kernel state and acquire initial data corresponding to the data processing request from a hardware storage device; a first processing unit, configured to, in response to determining that the initial data meets a preset requirement, perform serialization processing on the initial data to obtain target data; A mapping unit is used to map the target data to the physical memory and switch from the kernel state to the user state, so that the application program reads the target data from the physical memory and processes it.

9. The device according to claim 8, wherein When the first processing unit determines that the initial data meets the preset requirements, the first processing unit specifically performs: Acquire the data type of the initial data; When it is determined that the data type is a preset data type, it is determined that the initial data meets a preset requirement.

10. The device according to claim 8, wherein When the first processing unit determines that the initial data meets the preset requirements, the first processing unit specifically performs: Acquire the data size of the initial data; When it is determined that the data size is greater than a preset threshold, it is determined that the initial data meets a preset requirement.

11. The device according to claim 8, wherein When the first processing unit serializes the initial data to obtain target data, it specifically performs the following steps: Serializing the initial data to obtain data to be encrypted; Encrypting the data to be encrypted using a secret key to obtain encrypted data; The secret key is stored in the encrypted data to obtain the target data.

12. The device according to claim 8, wherein When mapping the target data to the physical memory, the mapping unit specifically performs: Acquire the data size of the target data; Creating a target mapping area in the physical memory according to the data size; The target data is mapped to the target mapping area.

13. The apparatus according to claim 11, further comprising a second processing unit configured to execute: In response to determining that the application accesses the physical memory, obtaining key location information; extracting a secret key from the target data according to the secret key location information; Decrypting the target data using the secret key to obtain decrypted data; The decrypted data is deserialized to obtain initial data, so that the application program processes the obtained initial data.

14. The device according to claim 13, wherein When obtaining the key location information, the second processing unit specifically performs: Get the danger level of the terminal device; In response to determining that the danger level is a preset level, the key location information is obtained from a server.

15. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

17. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Video processing method in Linux system

    CN105450986A

  • Data transmission method and device based on RDMA (Remote Direct Memory Access) under Linux operating system

    CN112948318A