Image formation control method and device and storage medium
By creating memory mapped files and segmentation and scaling processing in terminal devices, the system memory shortage during high-resolution, large-size image scanning and scaling operations is solved, and normal scanning and scaling functions are realized, improving the user experience.
Patent Information
- Application Number
- CN202411573231.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-28
AI Technical Summary
In image scanning scenarios, high-resolution, large-size files to be scanned often cannot complete the scanning process normally, or the scanned image cannot be scaled.
By creating a memory mapped file in the terminal device, receiving scan data sent by the image forming device, and segmenting and scaling processing when needed, avoiding the problem of insufficient system memory.
It realizes normal scanning and scaling of high-resolution and large-size images with limited system memory, improving the user experience.
Smart Images

Figure CN119537313A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image forming technology, and in particular, to an image forming control method, device and storage medium. Background Art
[0002] In the image scanning scenario, the user can set the scanning parameters on the terminal device, and then send the scanning job to the scanning device through the terminal device, and the scanning device scans the scanned file. Subsequently, the scanning device can send the scanned image to the terminal device for the user to view and save.
[0003] However, for high-resolution, large-size documents to be scanned, the following abnormal situations often occur, such as: the scanning operation cannot be performed, or the scanning operation can be performed but the terminal device cannot scale the scanned image after receiving the scanned image sent by the scanning device. Summary of the invention
[0004] In view of this, the present application provides an image formation control method, device and storage medium, which are used to solve the problem that high-resolution and large-size scanned files cannot be scanned normally in image scanning scenarios.
[0005] In a first aspect, an embodiment of the present application provides an image formation control method, which is applied to a terminal device, and the method includes: creating a first memory mapping file in response to a scan trigger operation on a target file; controlling the image forming device to perform a scanning operation on the target file; receiving scan data of the target file sent by the image forming device, and writing the scan data into the first memory mapping file.
[0006] In a possible implementation, before creating the first memory mapping file, the method further includes: determining that the system memory of the terminal device does not meet a preset condition.
[0007] In one possible implementation, determining that the system memory of the terminal device does not meet a preset condition includes: obtaining scanning parameters of the target file, the scanning parameters including the size of the target file and the resolution of the target file; determining that the size of the target file is greater than a size threshold, and the resolution is greater than a resolution threshold; wherein the size threshold and the resolution threshold are pre-set according to the system memory of the terminal device.
[0008] In one possible implementation, determining that the system memory of the terminal device does not meet a preset condition includes: calling a target function, where the target function is used to allocate system memory for the scan data; and determining that the target function returns a first target value, where the first target value is used to indicate a failure in allocating system memory.
[0009] In one possible implementation, the method further includes: creating at least one second memory mapping file in response to a scaling operation on the scan data of the target file; scaling the scan data of the target file, and writing the scaled scan data into the at least one second memory mapping file.
[0010] In one possible implementation, in response to a scaling operation on the scanned data of the target file, at least one second memory-mapped file is created, including: obtaining a scaling parameter in response to the scaling operation on the scanned data of the target file; determining the number of files of the second memory-mapped file to be created based on the scaling parameter; and creating at least one second memory-mapped file according to the number of files.
[0011] In one possible implementation, the scan data of the target file is scaled, and the scaled scan data is written into the at least one second memory mapping file, including: splitting the scan data into at least one sub-scan data; scaling the at least one sub-scan data respectively to obtain at least one target sub-scan data; and writing the at least one target sub-scan data respectively into the at least one second memory mapping file.
[0012] In one possible implementation, the method further includes: in response to a storage operation on the scaled scan data, reading the at least one target sub-scan data from the at least one second memory mapping file; splicing the at least one target sub-scan data to obtain target scan data; and storing the target scan data to the target storage space.
[0013] In a possible implementation, after storing the target scan data in the target storage space, the method further includes: deleting the first memory mapping file and the at least one second memory mapping file.
[0014] In a second aspect, an embodiment of the present application provides an image formation control device, comprising: a management module, used to create a first memory mapping file in response to a scan trigger operation on a target file; a control module, used to control the image forming device to perform a scanning operation on the target file; and an acquisition module, used to receive scanning data of the target file sent by the image forming device, and write the scanning data into the first memory mapping file.
[0015] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any method described in the first aspect.
[0016] The present application provides an image formation control method, device and storage medium, which have at least the following technical effects:
[0017] Through the above technical solution, when the system memory of the terminal device is limited, the scaling operation of the scanned data of the high-resolution and large-size image can be normally implemented, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0019] Figure 1 A schematic diagram of a flow chart of an image formation control method provided in an embodiment of the present application;
[0020] Figure 2 Another schematic flow chart of the image formation control method provided in the embodiment of the present application;
[0021] Figure 3 Another schematic flow chart of the image formation control method provided in the embodiment of the present application;
[0022] Figure 4 A schematic diagram of the structure of an image forming device provided in an embodiment of the present application;
[0023] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0025] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0026] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0027] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0028] In the image scanning scenario, the user can set the scanning parameters on the terminal device, and then send the scanning job to the scanning device through the terminal device, and the scanning device scans the scanned file. Subsequently, the scanning device can send the scanned image to the terminal device for the user to view and save.
[0029] However, for high-resolution, large-size documents to be scanned, the following abnormal situations often occur, such as: the scanning operation cannot be performed, or the scanning operation can be performed but the terminal device cannot scale the scanned image after receiving the scanned image sent by the scanning device.
[0030] After research, it was found that this was caused by the failure to allocate the system memory space of the terminal device, and the failure to allocate the memory space was caused by the insufficient system space of the terminal device or exceeding the maximum allocable memory required by the terminal device. Specifically, the quality of the scanned image often depends on the resolution and the scan size, and high-resolution and large-size scanned images often require more memory space to process. Before the terminal device sends the scanning job to the scanning device, it is necessary to allocate memory space for receiving the scanned image. The size of the memory space to be allocated is related to the scanning parameters of the scanning job. The higher the resolution and the larger the size, the larger the memory space to be allocated. Then, in a possible scenario, due to the limited system memory, it is easy to fail to allocate enough memory space for high-resolution and large-size files to be scanned. Exemplarily, for a terminal device with a system memory less than 4G, when the memory space to be allocated exceeds 800M, it is easy to fail to allocate the system memory. At this time, the terminal device will terminate the current scanning task, will not send the scanning job to the image forming device, and an abnormal situation of scanning failure will occur. Or, in another possible scenario, the terminal device allocates enough memory space to receive the scanned data and sends the scanning job normally. After the terminal device receives the scanned data sent by the image forming device, the user wants to perform a zoom operation on the scanned data. However, performing the zoom operation will further consume the system memory, so the originally allocated memory space may not be sufficient to meet the memory requirements of the zoomed scanned image. For example, if a 100M-sized scanned image needs to be zoomed in by 400%, that is, zoomed in by 4 times, 1600M of memory space needs to be allocated. If the scan driver limits the allocation of system memory space to 100M, the originally allocated memory space is a maximum of 100M, so the originally allocated 100M memory space is insufficient to meet the memory requirements of the zoomed scanned image. At this time, the terminal device will not be able to normally implement the zooming process of the scanned data.
[0031] This application is filed to address the above issues.
[0032] After receiving a scan trigger operation issued by the user, the present application can create a memory mapping file based on the memory mapping mechanism, and use the memory mapping file to receive the scan data sent by the image forming device, thereby preventing the abnormal situation where high-resolution and large-size files cannot use the scanning function normally.
[0033] The technical solution provided in the present application can be applied to a terminal device, and specifically to a scanning driver of a terminal device. The terminal device can be connected to an image forming device, and control the image forming device to perform a scanning operation, and receive scan data sent by the image forming device. The terminal device can be, for example, a personal computer (PC), a mobile phone, etc. The image forming device can be, for example, a scanner, a printer, and a multifunction machine that integrates printing, copying, faxing, scanning, etc.
[0034] The technical solutions provided in this application are described in detail in the following examples.
[0035] Figure 1 The following is a flow chart of an image forming control method provided in an embodiment of the present application. Figure 1 As shown, the image formation control method provided by the embodiment of the present application may include:
[0036] 101. In response to a scan trigger operation on a target file, a terminal device creates a first memory mapping file.
[0037] In the embodiment of the present application, the terminal device may display a scan setting interface, and the user may set the scan parameters in the scan setting interface. The scan parameters may include, for example, the size, resolution, single-sided / double-sided scan, black-and-white / color scan, pixel value, paper size, file format, save path, file name, etc. of the target file to be scanned. After the scan parameter settings are completed, the user may trigger a scan operation on the target file to be scanned in the terminal device. In response to the received scan trigger operation, the terminal device may create a first memory-mapped file, and the first memory-mapped file may be used to store the scan data sent by the image forming device after the scan operation is completed.
[0038] Specifically, in one possible implementation, in response to a received scan trigger operation, the terminal device may directly create a first memory mapping file. In another possible implementation, in response to a received scan trigger operation, the terminal device may first determine whether its own system memory meets a preset condition. If the preset condition is not met, the first memory mapping file is created. If the preset condition is met, there is no need to create the first memory mapping file.
[0039] The step of determining whether the system memory satisfies the preset condition may be to determine whether the system memory is greater than a set threshold. When the system memory is greater than the set threshold, it is considered that the system memory satisfies the preset condition, and when the system memory is not greater than the set threshold, it is considered that the system memory does not satisfy the preset condition.
[0040] Alternatively, judging whether the system memory satisfies the preset condition may be judging whether the resolution of the target file to be scanned is greater than a resolution threshold, and whether the file size is greater than a size threshold. If the resolution of the target file is greater than the resolution threshold, and the file size is greater than the size threshold, it can be considered that the system memory does not meet the preset condition; if the resolution of the target file is not greater than the resolution threshold, and the file size is not greater than the size threshold, it can be considered that the system memory meets the preset condition. The values of the resolution threshold and the size threshold can be preset according to the system memory.
[0041] Alternatively, determining whether the system memory satisfies the preset condition may be to call a target function, which may be an Application Programming Interface (API) function, and the target function may be used to allocate system memory for the scanned data of the target file. When the return value of the target function is null, it may be determined that the allocation of the system memory fails, and at this point, it is considered that the system memory does not meet the preset condition.
[0042] In an embodiment of the present application, the file size of the first memory-mapped file created can be determined according to the scanning parameters set by the user. Specifically, the terminal device can calculate the size of the required storage space according to the scanning parameters set by the user, and then, can create a first memory-mapped file of the corresponding size according to the size of the required storage space. Exemplarily, assuming that the scanning parameters of the target file are A3 (11.69 inch x 16.54 inch) size, color image, 1200 dpi resolution, and the save format is BMP, then the size of the storage space required can be calculated as: 1200 dpi x 11.69 inch x 3 (color 3 channels) x 1200 dpi x 16.54 inch = 796.6 M bytes. Alternatively, the terminal device can directly call a specific function and use the specific function to determine the file size of the first memory-mapped file to be created.
[0043] 102. The terminal device controls the image forming device to perform a scanning operation on the target file.
[0044] 103. The terminal device receives the scanned data of the target file sent by the image forming device.
[0045] After the first memory-mapped file is created, the terminal device may first determine whether the first memory-mapped file is created successfully.
[0046] When it is determined that the first memory-mapped file is created successfully, the terminal device may send a scan job to the image forming device to trigger the image forming device to perform a scan operation on the target file. Furthermore, the image forming device may send the scanned data to the terminal device.
[0047] When it is determined that the creation of the first memory mapping file fails, the terminal device may terminate the current scanning task.
[0048] 104. The terminal device writes the scanned data into the first memory mapping file.
[0049] In the embodiment of the present application, based on the basic principle of the memory mapping mechanism, when the physical memory is insufficient, the operating system can use the hard disk space to simulate the random access memory (Random Access Memory, RAM). It can be understood that in the embodiment of the present application, the first memory mapping file created by the terminal device uses virtual memory, which is equivalent to a memory block, and the terminal device can read and write scan data to the first memory mapping file through a pointer. It should be noted that the storage of the scan data by the first memory mapping file is temporary storage.
[0050] Through the method provided in the embodiment of the present application, the scanning operation of high-resolution and large-size files can be normally implemented without affecting the execution efficiency of the scanning operation, thereby solving the problem that the scanning operation cannot be executed due to insufficient memory space in the terminal device system in the scanning scenario.
[0051] Figure 2 FIG. 1 is a flow chart of another image formation control method provided in an embodiment of the present application. Figure 2 As shown, further, after writing the scanned data into the first memory mapping file, the image formation control method provided by the embodiment of the present application may also include:
[0052] 201, the terminal device determines whether a scaling operation on the scanned data of the target file is received. If received, execute step 203, if not, execute step 202.
[0053] In the embodiment of the present application, after the terminal device receives the scanned data of the target file sent by the image forming device, the user can view the scanned data through the terminal device, and can also perform a zoom operation on the scanned data. The specific zoom ratio of the zoom operation can be set by the user, for example, it can be set within a zoom range of 25% to 400%.
[0054] If the terminal device determines that it has not received the user's zoom operation on the scanned data within the preset time period, then it can be considered that the user currently has no zooming demand. At this time, step 202 can be executed to directly store the scanned file in the first memory mapping file to the target storage space. The target storage space can be, for example, a physical storage medium of the terminal device, such as a mechanical hard disk, a solid-state hard disk, etc. It should be noted that the storage of the scanned data in the target storage space is long-term storage. Furthermore, after the first memory mapping file is stored in the target storage space, the terminal device can delete the first memory mapping file. In this way, it can prevent the memory mapping file that has lost its function from continuing to occupy the hard disk space.
[0055] If the terminal device determines that a scaling operation of the scanned data is received by the user, then since the scaling operation requires resampling and adjustment of the original image data, memory consumption will be further increased, and therefore, the original first memory mapping file will not be sufficient to store the scaled scanned data. To prevent the scaling failure caused by the failure to allocate memory space, at this time, step 203 may be executed to create at least one second memory mapping file, and the at least one second mapping file may be used to store the scaled scanned data.
[0056] 202. The terminal device stores the scanned data in the first memory-mapped file into the target storage space, and deletes the first memory-mapped file.
[0057] 203. The terminal device creates at least one second memory-mapped file.
[0058] In an embodiment of the present application, the terminal device may first call a related function, such as a specific API function, to allocate system memory for the scaled scan data. If the system memory allocation is successful, it means that the system memory is sufficient to store the scaled scan data, and then there is no need to create a second memory mapping file. If the system memory allocation fails, it means that the system memory is insufficient to store the scaled scan data, and then at least one second memory mapping file may be created.
[0059] Specifically, the number of the second memory-mapped files created can be determined according to the scaling parameters set by the user and the maximum allocatable memory required by the terminal device. Exemplarily, the terminal device can calculate the size of the storage space required for the scaled scanned data according to the scaling parameters set by the user. Specifically, assuming that a scanned image of size 100M needs to be enlarged by 400%, that is, the scanned image is enlarged by 4 times, then its resolution (number of pixels) becomes 4 times of the original, and its data volume becomes 16 times of the original, and the data volume after enlargement is calculated to be 1600M. Further, the number of the second memory-mapped files to be created can be determined according to the size of the storage space required for the scaled scanned data and the maximum allocatable memory required by the terminal device. Among them, the size of each second memory-mapped file can be determined according to the maximum allocatable memory required by the terminal device. Specifically, it is determined according to the maximum allocatable memory required by the scanning driver of the terminal device. Assuming that the maximum allocatable memory required by the terminal device is 100M, at this time, a memory space larger than 100M cannot be allocated. Since the memory mapping mechanism is virtual memory, it is impossible to create a memory-mapped file larger than 100M. Therefore, in the embodiment of the present application, the size of the second memory mapping file can be set equal to the maximum allocatable memory required by the terminal device system. Therefore, if a 100M scanned image is enlarged by 400%, 16 100M second mapping files need to be created. It can be understood that when the size of the storage space required for the scaled scanned data does not exceed the maximum allocatable memory of the system, the number of second memory mapping files to be created is 1.
[0060] 204. The terminal device performs scaling processing on the scanned data of the target file, and writes the scaled scanned data into at least one second memory-mapped file.
[0061] In the embodiment of the present application, after the second memory-mapped file is created, the terminal device can read the scanned data of the target file from the first memory-mapped file, and scale the scanned data read according to the scaling parameters set by the user. Furthermore, the terminal device can store the scaled scanned data in at least one second memory-mapped file.
[0062] In a specific implementation, after the terminal device reads the scan data of the target file from the first memory-mapped file, it can first split the scan data according to the number of the second memory-mapped files to obtain at least one sub-scan data matching the number of the second memory-mapped files. Then, the terminal device can scale the at least one sub-scan data to obtain only one sub-target scan data. Furthermore, the terminal device can write the at least one sub-target scan data into at least one second memory-mapped file.
[0063] Through this implementation, the complete scan data is processed in slices, which can improve the processing efficiency of the scaling process and solve the problem of scaling failure caused by memory space failure.
[0064] Furthermore, in response to the user's operation of saving the scaled scan data, the terminal device can also read the at least one sub-target scan data from the at least one second memory mapping file, and then the terminal device can splice the read at least one sub-target scan data to obtain the complete scaled scan data. Then, the terminal device can store the complete scaled scan data to the target storage space for permanent storage.
[0065] Furthermore, after storing the scanned data after the complete scaling process in the target storage space, the terminal device may also delete the above-mentioned second memory mapping files, thereby preventing the memory mapping files that have lost their functions from continuing to occupy the hard disk space.
[0066] Through the above technical solution, the scaling operation of the scanned data of a high-resolution and large-size image can be normally implemented when the system memory of the terminal device is limited.
[0067] Figure 3 This is a complete implementation flow diagram of the image formation control method provided in the embodiment of the present application. Figure 3 As shown, in an exemplary implementation scenario, the image formation control method provided by the embodiment of the present application may include:
[0068] First, the terminal device may include a specific scanning application, which may display a scanning setting interface, and the scanning setting interface may include scanning parameter setting options, and the scanning parameter setting options may include, for example, setting options for the scanning source, file size setting options, resolution setting options, etc. Among them, the scanning source may include a platen and an automatic document feeder. The user may start the above scanning application in the terminal device and set various scanning parameters in the displayed scanning setting interface. Furthermore, the scanning setting interface may also include a scanning trigger button. After the scanning parameters are set, the user may also trigger the scanning operation of the target file based on the scanning trigger button.
[0069] Furthermore, in response to the user's scan trigger operation, the terminal device can determine whether the system memory is successfully allocated for the scan data of the target file. If it is successfully allocated, it is not necessary to create the first memory mapping file, and the scan data sent by the image forming device can be directly written using the allocated system memory. If it is not successfully allocated, the first memory mapping file can be created. In the case where the first memory mapping file is successfully created, the scan data sent by the image forming device can be written using the first memory mapping file. In the case where the first memory mapping file fails to be created, the current scanning task can be terminated.
[0070] Furthermore, the terminal device may detect whether an image zoom operation triggered by a user is received. If no image zoom operation is received, the terminal device may read the scan data temporarily stored in the first memory mapping file into a physical storage medium for permanent storage. Thus, the current scanning task may be terminated. If an image zoom operation is received, the terminal device may determine whether the system memory is successfully allocated for the scaled scan data. If it is successfully allocated, there is no need to create a second memory mapping file, and the scaled scan data may be directly written using the allocated system memory, and the scaled scan data may be permanently saved using a physical storage medium. If it is not successfully allocated, the terminal device may create a second memory mapping file. If the second memory mapping file is successfully created, the scaled scan data may be written using the second memory mapping file. If the second memory mapping file fails to be created, the current scanning task may be terminated.
[0071] Through the above technical solution, in a low-configuration device with a small system memory, high-resolution and large-size files to be scanned can use the scanning function and the scaling function of the scanned data normally, thereby improving the user experience.
[0072] Figure 4 A schematic diagram of the structure of the image forming control device provided in the embodiment of the present application. Figure 4 As shown, the image formation control device provided in the embodiment of the present application may include: a management module 41 , a control module 42 and an acquisition module 43 .
[0073] The management module 41 is used to create a first memory mapping file in response to a scan trigger operation on a target file.
[0074] The control module 42 is used to control the image forming device to perform a scanning operation on the target file.
[0075] The acquisition module 43 is used to receive the scan data of the target file sent by the image forming device, and write the scan data into the first memory mapping file.
[0076] In a specific implementation, the management module 41 is further configured to determine that the system memory of the terminal device does not meet a preset condition.
[0077] In a specific implementation, the management module 41 is specifically used to obtain scanning parameters of the target file, the scanning parameters including the size of the target file and the resolution of the target file; determine that the size of the target file is greater than a size threshold and the resolution is greater than a resolution threshold; wherein the size threshold and the resolution threshold are pre-set according to the system memory of the terminal device.
[0078] In a specific implementation, the management module 41 is specifically used to call a target function, where the target function is used to allocate system memory for scan data; and determine that the target function returns a first target value, where the first target value is used to indicate a failure in allocating system memory.
[0079] In a specific implementation, the management module 41 is also used to create at least one second memory mapping file in response to a scaling operation on the scan data of the target file; scale the scan data of the target file, and write the scaled scan data into at least one second memory mapping file.
[0080] In a specific implementation, the management module 41 is specifically used to obtain scaling parameters and the maximum allocatable memory required by the terminal device in response to a scaling operation on the scanned data of the target file; determine the number of files of the second memory mapping file to be created based on the scaling parameters and the maximum allocatable memory required by the terminal device; and create at least one second memory mapping file according to the number of files.
[0081] In a specific implementation, the management module 41 is specifically used to split the scan data into at least one sub-scan data; scale the at least one sub-scan data to obtain at least one target sub-scan data; and write the at least one target sub-scan data into at least one second memory mapping file.
[0082] In a specific implementation, the acquisition module 43 is also used to, in response to a storage operation on the scan data after scaling, read at least one target sub-scan data from at least one second memory mapping file; splice at least one target sub-scan data to obtain target scan data; and store the target scan data in the target storage space.
[0083] In a specific implementation, the acquisition module 43 is further configured to delete the first memory-mapped file and at least one second memory-mapped file.
[0084] Through the above technical solution, in a low-configuration device with a small system memory, high-resolution and large-size files to be scanned can use the scanning function and the scaling function of the scanned data normally, thereby improving the user experience.
[0085] Corresponding to the above embodiments, the present application also provides an electronic device. Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device 400 may include: a processor 401, a memory 402 and a communication unit 403. These components communicate through one or more buses, and those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiment of the present application, it can be a bus structure or a star structure, and can also include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.
[0086] The communication unit 403 is used to establish a communication channel so that the electronic device can communicate with other devices, receive user data sent by other devices or send user data to other devices.
[0087] The processor 401 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It runs or executes software programs, instructions, and / or modules stored in the memory 402, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 401 can only include a central processing unit (CPU). In the embodiment of the present application, the CPU can be a single computing core or multiple computing cores.
[0088] The memory 402 is used to store the execution instructions of the processor 401. The memory 402 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0089] When the execution instructions in the memory 402 are executed by the processor 401, the electronic device 400 is enabled to execute part or all of the steps in the various embodiments of the present application.
[0090] In a specific implementation, the present application further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the image formation control method provided by the present application. The storage medium may be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0091] In a specific implementation, the present application also provides a computer program product, wherein the computer program product includes executable instructions, and when the executable instructions are executed on a computer, the computer executes part or all of the steps in each embodiment of the image formation control method provided in the present application.
[0092] Those skilled in the art can clearly understand that the technology in the embodiments of the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solutions in the embodiments of the present application are essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0093] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0094] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0095] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0096] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0097] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0098] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0099] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
[0100] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
Claims
1. An image formation control method, characterized in that: Applied to a terminal device, the method comprises: In response to a scan trigger operation on a target file, creating a first memory-mapped file; Controlling the image forming device to perform a scanning operation on the target document; The scanning data of the target file sent by the image forming device is received, and the scanning data is written into the first memory mapping file.
2. The method according to claim 1, characterized in that Before creating the first memory-mapped file, the method further includes: It is determined that the system memory of the terminal device does not meet a preset condition.
3. The method according to claim 2, characterized in that Determining that the system memory of the terminal device does not meet a preset condition includes: Acquire scanning parameters of the target file, wherein the scanning parameters include the size of the target file and the resolution of the target file; Determining that the size of the target file is greater than a size threshold and the resolution is greater than a resolution threshold; The size threshold and the resolution threshold are pre-set according to the system memory of the terminal device.
4. The method according to claim 2, characterized in that: Determining that the system memory of the terminal device does not meet a preset condition includes: Calling a target function, wherein the target function is used to allocate system memory for the scan data; It is determined that the objective function returns a first objective value, where the first objective value is used to indicate a failure in allocating system memory.
5. The method according to claim 1, characterized in that The method further comprises: In response to a scaling operation on the scanned data of the target file, creating at least one second memory mapped file; Scaling is performed on the scanned data of the target file, and the scaled scanned data is written into the at least one second memory-mapped file.
6. The method according to claim 5, characterized in that In response to a scaling operation on the scanned data of the target file, creating at least one second memory-mapped file, comprising: In response to a scaling operation on the scanned data of the target file, obtaining a scaling parameter and a maximum allocatable memory required by the terminal device; Determining the number of files of the second memory-mapped file to be created according to the scaling parameter and the maximum allocatable memory required by the terminal device; At least one second memory-mapped file is created according to the number of files.
7. The method according to claim 5, characterized in that Scaling the scanned data of the target file and writing the scaled scanned data into the at least one second memory-mapped file includes: Splitting the scan data into at least one sub-scan data; Performing scaling processing on the at least one sub-scanning data respectively to obtain at least one target sub-scanning data; The at least one target sub-scan data is written into the at least one second memory-mapped file respectively.
8. The method according to claim 7, characterized in that The method further comprises: In response to a storage operation on the scaled scan data, reading the at least one target sub-scan data from the at least one second memory-mapped file; splicing the at least one target sub-scan data to obtain target scan data; The target scan data is stored in the target storage space.
9. The method according to claim 8, characterized in that After storing the target scan data in the target storage space, the method further includes: The first memory-mapped file and the at least one second memory-mapped file are deleted.
10. An image forming control device, characterized in that: include: A management module, configured to create a first memory mapping file in response to a scan trigger operation on a target file; A control module, used for controlling the image forming device to perform a scanning operation on the target file; The acquisition module is used to receive the scan data of the target file sent by the image forming device, and write the scan data into the first memory mapping file.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 9.