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

By switching user state to kernel state in Android system applications, obtaining and serializing data from hardware storage, and then mapping it to physical memory, the problem of low read and write data of Android application data is solved, and processing speed and security is improved.

CN119781835AActive Publication Date: 2025-04-08BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Applications based on Android systems have problems such as slow speed and low security in terms of data read and write performance.

Method used

After receiving the application's data processing request, the user state switches to the kernel state, obtains the initial data from the hardware storage device, and performs serialization processing when the preset requirements are met, obtains the target data, and then maps it to physical memory, allowing the application to read and process data directly from the physical memory.

Benefits of technology

It improves the speed and efficiency of applications when processing data, reduces the resource usage of physical memory, and improves the accuracy of data mapping and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781835A_ABST
    Figure CN119781835A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, electronic equipment and a readable storage medium, and relates to the technical field of artificial intelligence such as big data and cloud services. The data processing method comprises the steps that after a data processing request sent by an application program is received, a user mode is switched to a kernel mode, and initial data corresponding to the data processing request is acquired from a hardware storage device; in response to determining that the initial data meets a preset requirement, performing serialization processing on the initial data to obtain target data; and mapping the target data to a physical memory, and switching from a kernel mode to a user mode, so that the application program reads the target data from the physical memory and processes the target data. The data processing speed and efficiency of the application program can be improved, the resource occupation of a physical memory is reduced, and the data mapping accuracy and the data processing accuracy of the application program are improved.
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 the field of artificial intelligence technology 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 popularity of smart terminal devices, the number of applications based on the Android system is becoming more and more abundant. With the continuous increase in the number of users and the continuous expansion of business, the data reading and writing performance of applications based on the Android system has become a key challenge, while traditional data reading and writing methods have problems such as slow reading and writing speed 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 a user state to a kernel state, and acquiring 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 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.

[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 so that the at least one processor can execute the method as 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 cause 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 as described above when executed by a processor.

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

[0009] The accompanying drawings are used to better understand the present solution 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 of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0015] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and mechanisms is 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 a user state to a kernel state, and acquiring 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, serializing the initial data to obtain target data;

[0019] S103: 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.

[0020] The executor of the data processing method of this embodiment is a terminal device or an 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, the operations of serializing the initial data and mapping the target data to the physical memory are executed, which can reduce the resource occupation of the physical memory and improve the accuracy of data mapping and the application in processing data.

[0021] In this embodiment, the terminal device includes a smart phone, a tablet, a notebook, a desktop computer, 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 a disk (a notebook or a desktop computer), a flash memory or an external storage card (a smart phone or a tablet computer), 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 program 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 a hardware storage device, and require the terminal device or operating system to switch to kernel mode and 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, the present embodiment includes identification information of the data to be processed in the received data processing request, 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, the present 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 (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, the present embodiment may 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] After executing S101 to obtain initial data corresponding to the data processing request from the hardware storage device, this embodiment executes 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 executing S102 and determining that the initial data meets the preset requirements, the implementation method that can be adopted is: obtaining the data type of the initial data; and when determining that the obtained data type is the 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 and a user attribute data type; that is, when this embodiment determines that the acquired initial data 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 and reduce the resource consumption of the physical memory, thereby improving the performance of the application when reading and writing core data.

[0030] In addition, when this embodiment performs S102 and determines that the initial data meets the preset requirements, the implementation method that can be adopted is: obtaining the data size of the initial data; and when it is determined that the obtained data size is greater than a preset threshold, determining that the initial data meets the preset requirements.

[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 and reduce the resource consumption of physical memory, thereby improving the performance of the application when reading and writing large data.

[0032] When executing S102, this embodiment 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.

[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 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] When executing S103 to map the target data to the physical memory, the implementation method that can be adopted in this embodiment 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 the kernel state to the user state, 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 also 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 changes.

[0040] The CRC value of the initial data corresponding to the target data in the physical memory is compared 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 are 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 is a schematic diagram according to the second embodiment of the present disclosure. Figure 2 As shown in , when executing S102 “serializing the initial data to obtain target data”, this embodiment may include the following contents:

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

[0044] S202, encrypting 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 initial data, so that while the data size of the target data can be reduced, the security of the target data can also be improved. 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.

[0047] When executing S201, this embodiment may use a binary serialization method to serialize the initial data, thereby obtaining 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 can 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 secret keys is 5, when executing S203, this embodiment can store the 5 secret keys at the 1st, 3rd, 5th, 7th and 9th positions from the end of the encrypted data, or store the 5 secret keys at the 2nd, 4th, 6th, 8th and 10th positions from the beginning of the encrypted data, or store the 5 secret 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 product device, and if the match is successful, obtain a high danger level as the danger level of the current terminal device), and then, when it is determined that the obtained danger level is a preset level (the preset level is a high danger 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.

[0054] In this embodiment, the danger level of the terminal device is used to reflect whether the terminal device is a gray product device; if the danger level is high, it indicates that the terminal device is very likely to be a gray product device, and there is a risk that the terminal device will illegally use the target data mapped in the physical memory, and it is necessary to store the key location information by the server 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 product device.

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

[0056] In this embodiment, it is possible to 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-risk unbinding, indicating that the current terminal device is more likely to be a gray product device), the key location information is obtained from the server side, otherwise the key location information is obtained from the local of the 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 the present embodiment when performing data processing 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, adopting 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 is a schematic diagram according to 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 used to switch from the user state to the kernel state after receiving the data processing request sent by the application, and acquire the initial data corresponding to the data processing request from the 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 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.

[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, and the identification information 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).

[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, the present embodiment may 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 the first processing unit 402 determines that the initial data meets the preset requirement, the implementation method that can be adopted is: obtaining the data type of the initial data; and when determining that the obtained data type is the 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 and a user attribute data type; that is, when this embodiment determines that the acquired initial data 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 and reduce the resource consumption of the physical memory, thereby improving the performance of the application when reading and writing core data.

[0070] In addition, when the first processing unit 402 determines that the initial data meets the preset requirements, the implementation method that can be adopted is: obtaining the data size of the initial data; and when it is determined that the obtained data size is greater than a preset threshold, determining 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 and reduce the resource consumption of physical memory, thereby improving the performance of the application when reading and writing large 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 performs serialization processing on the initial data to obtain the target data, the following contents may also be included: performing serialization processing on 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 the data size of the target data can be reduced while the security of the target data can be improved. When the initial data to be read and written by the application is core data, it is effectively ensured that the core data will not be tampered with before the application reads and writes.

[0076] The first processing unit 402 may use a random generation method to obtain a key for encrypting data; the first processing unit 402 may also obtain a preset key to encrypt the data to be encrypted, thereby obtaining encrypted data.

[0077] The first processing unit 402 may obtain the target data by storing the secret key at 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 at a random position in the encrypted data.

[0078] After storing the key in the encrypted data, the first processing unit 402 may also generate key location information according to the location information of the key in the encrypted data, and then send the generated key location information to the server; or the key location information may be directly stored 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 program reads the target data from the physical memory and processes it.

[0081] When mapping the target data to the physical memory, the mapping unit 403 may adopt the following implementation 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 the kernel state to the user state, 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, the target data in the target mapping area is deserialized to obtain the 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 execute the following: in response to determining that an application accesses physical memory (or a target mapping area in 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 product device), the key location information is obtained from the server side; otherwise, the key location information is obtained from the local of the terminal device.

[0087] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance 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 of an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, 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 required 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. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

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

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

[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 implementations 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), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

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

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

[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 a 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 may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may 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 the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.

[0100] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0101] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A data processing method, comprising: After receiving the data processing request sent by the application, switching from the user state to the kernel state, obtaining the initial data corresponding to the data processing request from the 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 process of the initial data to obtain the target data includes: Serializing the initial data to obtain data to be encrypted; Encrypt 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 can process the obtained initial data.

7. The method according to claim 6, wherein: The obtaining of the 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 secret key location information is obtained from a server.

8. A data processing device, comprising: an acquisition 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 performs serialization processing on the initial data to obtain the target data, the first processing unit specifically executes: Serializing the initial data to obtain data to be encrypted; Encrypt 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 can process 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 secret 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

  • Data transmission method, device and equipment based on Linux operating system

    CN114911568A

  • Data processing method and device, electronic equipment and storage medium

    CN115599571A

  • Data transmission method and device, computer equipment and storage medium

    CN115718707A