Memory display method and device, equipment and storage medium
By drawing and updating the memory usage status diagram, the memory usage situation is intuitively displayed, and the problem of unintuitive memory display in the existing technology is solved, helping operators to reasonably adjust memory to ensure the normal operation of the equipment.
Patent Information
- Application Number
- CN202411104642.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-29
AI Technical Summary
The display method of memory occupancy status in the prior art is not intuitive, and it is difficult to help operators effectively adjust memory to ensure the normal operation of the equipment.
By drawing a memory occupancy status diagram, displaying unoccupied byte blocks and memory byte blocks occupied by each command, updates with graphic markers to visually display memory occupancy, including initial drawing, erasing, and redrawing of graphic markers to reflect Memory usage changes.
It realizes intuitively displaying which byte blocks in memory is occupied and the specific byte block intervals occupied by each command, which facilitates operators to make reasonable use of memory space and avoid device crashes or slow operation.
Smart Images

Figure CN119045933A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of memory processing technology, and in particular to a memory display method, device, equipment and storage medium. Background Art
[0002] In the prior art, the device memory occupancy status is usually displayed in digital form or in a bar graph. This display method can only show how much of the device memory is currently used and how much is not used, that is, it can only know the proportion of byte blocks in the memory that are occupied and the proportion that are not occupied. This memory display method is not intuitive and is not conducive to the operator's handling of the memory. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a memory display method, apparatus, device and storage medium to intuitively display the status of memory byte occupancy so that operators can adjust the memory to ensure normal operation of the device.
[0004] In a first aspect, an embodiment of the present application provides a memory display method, comprising:
[0005] Draw and display a memory occupancy status diagram according to the total number of memory byte blocks occupied by all commands, a preset base and the interval of the memory byte blocks occupied by each command; wherein the display content of the memory occupancy status diagram includes unoccupied byte blocks and memory byte blocks occupied by each command;
[0006] When updating the memory byte block occupied by any of the commands, an update instruction of the target command is obtained, and the graphic mark of the memory occupied byte block of the target command is updated according to the update instruction to form a new memory occupation state diagram.
[0007] In some embodiments, drawing and displaying a memory occupancy state diagram according to the total number of memory byte blocks occupied by all commands, a preset base, and an interval of memory byte blocks occupied by each command includes:
[0008] Based on the total number of memory byte blocks occupied by all commands and the preset base, a memory arrangement diagram is drawn according to a preset arrangement rule; wherein the corresponding position of each byte block in the memory arrangement diagram is initially drawn with a first graphic mark, and gaps are left between the corresponding positions of adjacent byte blocks;
[0009] Based on the interval of the memory occupied byte block of each command, the first graphic mark at the corresponding position of the memory occupied byte block of the corresponding command in the memory arrangement diagram is erased, and a second graphic mark is redrawn at the corresponding position of the memory occupied byte block of the corresponding command to form the memory occupation status diagram and display it; wherein the interval of the initial occupied memory byte block of each command is determined by the starting byte block and the ending byte block of each command.
[0010] In some embodiments, drawing a memory arrangement diagram based on the total number of memory byte blocks occupied by all commands and a preset base according to a preset arrangement rule includes:
[0011] The number of rows and columns to be drawn is determined according to the total number of memory byte blocks and the preset base value; wherein the number of rows is the total number of memory byte blocks divided by the preset base value and rounded to an integer. If there is no remainder after rounding, the number of rows is the rounded number; if there is a remainder after rounding, the number of rows is the rounded number plus 1; the number of columns is equal to the preset base value;
[0012] According to the number of rows and the number of columns of each byte block, the corresponding position of each byte block is determined, and a first graphic mark is drawn at the corresponding position of each byte block to form the memory arrangement diagram; wherein, if there is a remainder after rounding, the remainder of the first graphic mark is drawn in the last row.
[0013] In some embodiments, the method further includes: setting a marker number of the byte block at the beginning of the corresponding row in a blank area adjacent to the first column of the memory occupancy status diagram; wherein the marker number is a serial number of the byte block at the beginning of the corresponding row expressed in a preset base.
[0014] In some embodiments, if the update operation is a modify command operation, the step of obtaining the update instruction of the target command and updating the memory occupied byte block of the target command according to the update instruction to form a new memory occupied state diagram further includes:
[0015] In response to a selection operation in the memory occupancy status diagram, the second graphic mark of the selected position corresponding to the selection operation is erased, and a third graphic mark is drawn on the corresponding selected position, or the third graphic mark is drawn over the second graphic mark of the corresponding selected position of the selection operation; wherein the corresponding selected position is the corresponding position of the byte block of the corresponding command of the selection operation.
[0016] In some embodiments, updating the graphic mark of the memory occupied byte block of the target command according to the update instruction includes:
[0017] Obtaining the memory occupied byte block interval after the target command in the update instruction is modified; wherein the memory occupied byte block interval after the target command is modified is the interval from the modified start byte block to the modified end byte block of the target command;
[0018] Erasing all the graphic marks at the corresponding selected position, and drawing the first graphic mark at the corresponding selected position, or overdrawing the first graphic mark on the third graphic mark at the corresponding selected position; erasing all the graphic marks at the corresponding position of the memory occupied byte block interval after the target command is modified, and drawing the second graphic mark at the corresponding position of the memory occupied byte block interval after the target command is modified, or overdrawing the second graphic mark on the first graphic mark at the corresponding position of the memory occupied byte block interval after the target command is modified; wherein, the second graphic mark corresponding to each command is associated with each other.
[0019] In some embodiments, if the update operation is a new command operation, then updating the graphic mark of the memory occupied byte block of the target command according to the update instruction includes:
[0020] Obtaining the occupied byte block interval of the newly added command in the update instruction; wherein the byte block interval of the newly added command is the interval from the starting byte block of the newly added command to the ending byte block of the newly added command;
[0021] All the graphic marks at the corresponding positions of the memory occupied byte block interval of the newly added command are erased, and the second graphic mark is drawn at the corresponding position of the memory occupied byte block interval of the newly added command, or the second graphic mark is drawn over the first graphic mark at the corresponding position of the memory occupied byte block interval of the newly added command; wherein the second graphic mark corresponding to each command is associated with each other.
[0022] In a second aspect, an embodiment of the present application provides a memory display device, comprising:
[0023] A memory occupancy state diagram forming module, used to draw and display a memory occupancy state diagram according to the total number of memory byte blocks occupied by all commands, a preset base and the interval of the memory byte blocks occupied by each command; wherein the display content of the memory occupancy state diagram includes unoccupied byte blocks and memory byte blocks occupied by each command;
[0024] The memory occupancy status graph update module is used to obtain the update instruction of the target command when updating the memory byte block occupied by any of the commands, and update the graphic mark of the memory occupancy byte block of the target command according to the update instruction to form a new memory occupancy status graph.
[0025] In a third aspect, an embodiment of the present application provides an electronic device, comprising a display screen, a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the above-mentioned memory display method; the display screen is used to display the processing results of the memory by the processor.
[0026] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the above-mentioned memory display method when executed on a processor.
[0027] The embodiments of the present application have the following beneficial effects: the present application can draw and display the initial memory occupancy status diagram through the total number of memory byte blocks, the preset base and the initial memory byte block interval occupied by each command, and then when the command needs to be updated, it is only necessary to erase and draw the byte blocks occupied by the updated command. The method of the present application can intuitively display which byte blocks in the memory are occupied, and can intuitively display the specific byte block interval occupied by each command, so that the operator can clearly understand the memory occupancy so that the memory space can be reasonably used. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] 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. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 A schematic diagram of the structure of an electronic device according to an embodiment of the present application is shown;
[0030] Figure 2 A first schematic diagram showing a memory occupancy state diagram of an embodiment of the present application is shown;
[0031] Figure 3 A first flow chart of the memory display method according to an embodiment of the present application is shown;
[0032] Figure 4 A second flow chart of the memory display method according to an embodiment of the present application is shown;
[0033] Figure 5 A second schematic diagram showing a memory occupancy state diagram of an embodiment of the present application is shown;
[0034] Figure 6A third schematic diagram showing a memory occupancy state diagram of an embodiment of the present application is shown;
[0035] Figure 7 A third flow chart of the memory display method according to an embodiment of the present application is shown;
[0036] Figure 8 A fourth schematic diagram showing a memory occupancy state diagram of an embodiment of the present application;
[0037] Fig. 9 A fifth schematic diagram showing a memory occupancy state diagram of an embodiment of the present application is shown;
[0038] Fig.10 A fourth flow chart of the memory display method according to an embodiment of the present application is shown;
[0039] Fig.11 A structural schematic diagram of a memory display device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0041] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0042] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0043] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0044] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0045] For some devices that require memory to run, in the underlying program, a certain section of memory in the memory will be allocated to a certain functional module according to the needs of each functional module to support the normal operation of the functional module. Among them, devices that require memory to run include mobile phones, computers, iPads, switches, etc. Memory is extremely important for the normal operation of these devices. If the memory is used improperly, it is very easy to cause the program in the device to crash or run slowly. Based on this, the present application proposes a memory display method, device, equipment and storage medium to realize the intuitive display of the memory byte occupancy status, so that the operator can adjust the memory to ensure the normal operation of the device.
[0046] The electronic device according to the embodiment of the present application is first described below.
[0047] like Figure 1 As shown, the electronic device includes a display interface 10, a processor 20 and a memory 30. The memory 30 stores a computer program. The processor 20 is used to execute the computer program to implement the memory display method. The display interface 10 is used to display the processing result of the memory by the processor 20. The display interface of the display interface 10 is as shown in FIG. Figure 2 As shown, the display content includes but is not limited to the memory occupancy status diagram, the command update operation interface and the operation button, etc.; the byte block occupied by each command in the memory occupancy status diagram corresponds to the command update operation interface below, such as Figure 2 The light grey rectangular blocks are unoccupied byte blocks, and the dark grey rectangular blocks are byte blocks occupied by commands. Figure 2 It shows that the memory is occupied by 3 commands. The starting byte block of the byte block occupied by operation command 1 is 3, and the ending byte block is 11, which corresponds to the first 9 consecutive dark gray rectangular blocks; the starting byte block of the byte block occupied by operation command 2 is 13, and the ending byte block is 25, which corresponds to the second consecutive 13 dark gray rectangular blocks; the starting byte block of the byte block occupied by operation command 3 is 29, and the ending byte block is 40, which corresponds to the third consecutive 12 dark gray rectangular blocks.
[0048] Among them, the processor 20 can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0049] The memory 30 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electric erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor can execute the computer program accordingly after receiving the execution instruction. The memory display method is described below in conjunction with some specific embodiments.
[0050] Figure 3 A schematic flow chart of a memory display method according to an embodiment of the present application is shown. Exemplarily, the memory display method comprises the following steps:
[0051] Step S100, drawing and displaying a memory occupancy status diagram according to the total number of memory byte blocks occupied by all commands, a preset base and the memory byte block interval occupied by each command.
[0052] In this step, the total number of memory bytes of all commands set in a certain functional module or the entire system in the background, the base (positional counting system) used, all commands included in the functional module, and the starting byte block and ending byte block of the memory occupied byte block of each command are obtained. The memory occupation status diagram of the functional module can be drawn and displayed through the display interface.
[0053] The memory usage status diagram shows the memory byte blocks occupied by each command and the unoccupied byte blocks. Figure 2 As shown in the figure, a light gray rectangle or a dark gray rectangle represents a byte block. Figure 2 The light gray rectangular blocks represent the occupied byte blocks, and the dark gray rectangular blocks represent the memory byte blocks occupied by each command.
[0054] In some embodiments, Figure 4 As shown, step S100 includes:
[0055] Step S110, based on the total number of memory byte blocks occupied by all commands and a preset base, a memory arrangement diagram is drawn according to a preset arrangement rule.
[0056] The preset base may be base 64, base 16, base 10, base 10 or base 8.
[0057] According to the total number of memory bytes occupied by all commands in a certain functional module obtained by the underlying program and the preset base, the number of rows and columns of the drawn memory arrangement diagram can be determined; wherein, the number of rows is the total number of memory byte blocks divided by the preset base and rounded up. If there is no remainder, the number of rows is the rounded number; if there is a remainder after rounding, the number of rows is the rounded number plus 1; the number of columns is the preset base, that is, if the adopted base is hexadecimal, the number of columns is 16, and if the adopted base is 64, the number of columns is 64.
[0058] If the functional module is A, 65535 byte blocks of memory are allocated to it in the underlying program, and the preset base is determined to be hexadecimal in the underlying program, then these 65535 byte blocks are drawn and displayed in the hexadecimal arrangement order. When determining the number of rows and columns of the memory arrangement diagram, the number of columns is 16, and the number of rows is 65535 divided by 16, which is equal to 4095, and the remainder is 15, so it can be determined that the number of rows of the memory arrangement diagram is 4096. If the functional module is B, 65520 byte blocks of memory are allocated to it in the underlying program, and the preset base is determined to be hexadecimal in the underlying program, then these 65520 byte blocks are drawn and displayed in the hexadecimal arrangement order. When determining the number of rows and columns of the memory arrangement diagram, the number of columns is 16, and the number of rows is 65520 divided by 16, which is equal to 4095, and the remainder is 0, so it can be determined that the number of rows of the memory arrangement diagram is 4095.
[0059] After determining the number of rows and columns, the corresponding position of each byte block is determined according to the number of rows and columns of each byte block, and a first graphic mark is drawn at the corresponding position to form a memory arrangement diagram; wherein, if there is a remainder after rounding, then the remainder first graphic marks are drawn in the last row, that is, if there is a remainder after dividing the total number of memory bytes by the preset base, then when drawing the first graphic mark, only the remainder first graphic marks are drawn in the last row, and the remaining positions do not need to be drawn, that is, it is ensured that the number of the drawn first graphic marks is equal to the total number of memory bytes, so as to accurately reflect the memory occupancy.
[0060] The corresponding position of each byte block in the memory layout diagram is drawn with a first graphic mark, and gaps are left between the corresponding positions of adjacent byte blocks, so that the byte blocks can be easily distinguished.
[0061] Among them, the first graphic mark can be a graphic mark of a preset shape with a first color. For example, the preset shape can be a square, rectangle, circle, ellipse, rhombus, parallelogram, etc. The specific shape is not limited, and the first color is not limited, as long as it can be distinguished from the color of the gap. If the color of the gap displayed on the display screen is white, the first color may be light gray, dark gray, black, red, yellow, green, purple, etc. In the embodiment of the present application, the first graphic mark is illustrated by taking a light gray rectangular block as an example.
[0062] Step S120, based on the interval of the memory occupied byte block of each command, erase the first graphic mark at the corresponding position of the memory occupied byte block of the corresponding command in the memory arrangement diagram, and redraw it as a second graphic mark at the corresponding position of the memory occupied byte block of the corresponding command to form a memory occupation status diagram and display it.
[0063] Among them, the interval of the memory occupied byte block of each command is determined by the starting byte block and the ending byte block of each command; the unoccupied byte block is the byte block marked by the first graphic; the memory byte block occupied by each command is the byte block marked by the second graphic.
[0064] In this step, the total number of commands and the memory byte block interval occupied by each command are obtained from the underlying program, that is, the position from the starting byte block to the ending byte block occupied by each command and the number of byte blocks. When drawing the byte block occupied by each command, first erase the first graphic mark at the corresponding position of the memory arrangement diagram, and then draw the second graphic mark at the corresponding position of the memory byte block corresponding to the command. Figure 2The memory occupancy status diagram shown includes 3 commands. Operation command 1 occupies byte blocks 3-11, and the number of byte blocks occupied is 9. Operation command 2 occupies byte blocks 13-25, and the number of byte blocks occupied is 13. Operation command 3 occupies byte blocks 29-40, and the number of byte blocks occupied is 12. When drawing the command occupancy bytes on the memory arrangement diagram, erase the first graphic mark on the byte block position corresponding to each command in turn, and then draw the second graphic mark on the byte block position corresponding to the command to form the current memory occupancy status diagram.
[0065] Among them, the second graphic mark, like the first graphic mark, can also be a graphic mark of a second preset shape with a second color. It can be understood that in order to facilitate the distinction between the first graphic mark and the second graphic mark, the second graphic mark and the first graphic mark should be set as different marking graphics. The second graphic mark can be different in color from the first graphic mark, but the same in shape; the second graphic mark can also be the same in color as the first graphic mark, but different in shape; the second graphic mark can also be different in color and shape from the first graphic mark, and the color of the second graphic mark must also be different from the color of the gap. In the embodiment of the present application, the second graphic mark is represented by a dark gray rectangle.
[0066] It should be noted that if the second graphic mark and the first graphic mark have the same graphic shape and only the color is different, when drawing the second graphic mark at the corresponding position of each command memory occupied byte block in the memory occupation status diagram, it is not necessary to erase the first graphic mark, and the second graphic mark can be directly drawn on the corresponding position of each command memory occupied byte block.
[0067] In some implementations, a marker number of the byte block at the beginning of the corresponding row is set in a blank area adjacent to the first column of the memory occupancy status diagram; wherein the marker number is a sequence number of the byte block at the beginning of the corresponding row expressed in a preset base.
[0068] In this implementation, the number of rows and columns of the memory occupancy status diagram can be obtained based on the total number of memory bytes and the preset base, and each byte block in the memory occupancy status diagram is arranged in sequence. For example, if the total number of memory bytes is 65535 and the preset base is 16, the byte block values in the first row are 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, 0008, 0009, 000a, 000b, 000c, 000d, 000e and 000f, respectively, and each byte block value represents a byte block. The second row is also arranged in sequence, and the byte blocks in the second row are 0010, 0011...001f, respectively, and the subsequent byte blocks are also sorted in hexadecimal order.
[0069] In order for the operator to be able to intuitively view the memory usage status, in this implementation, Figure 2 As shown, a marker number is added in front of each line of the memory occupancy status diagram, and the marker number is the serial number of the first byte block of the line. Taking the above hexadecimal as an example, 0000 is added in front of the first line, indicating that the first byte block of the first line of the memory occupancy status diagram is decimal 0, and 0010 is added in front of the second line, indicating that the first byte block of the second line of the memory occupancy status diagram is decimal 16, and 0020 is added in front of the second line, indicating that the first byte block of the third line of the memory occupancy status diagram is decimal 32. In this way, the operator can intuitively know the starting byte block and the ending byte block in a certain line of byte blocks according to the memory occupancy status diagram, so as to modify the byte block corresponding to the command later.
[0070] Step S200, when updating the memory byte block occupied by any command, obtain the update instruction of the target command, and update the graphic mark of the memory occupied byte block of the target command according to the update instruction to form a new memory occupation state diagram.
[0071] In this step, if a functional module is upgraded, it may involve the addition, deletion or change of commands. Therefore, it is possible that the memory byte blocks currently allocated for each command are insufficient to support the normal operation of the command. Therefore, it is necessary to update the memory byte blocks occupied by each command so that each command can run normally. For example, a functional module currently has a total of 60,000 memory bytes, including two commands. The first command occupies memory bytes from the 200th to 3000th byte blocks (for ease of expression, it is described in decimal), and the second command occupies byte blocks from the 3500th to 5600th byte blocks. Therefore, the number of bytes currently unoccupied is the first 200, plus the middle 499, plus the last 400, that is to say, the occupied byte blocks are scattered. At this time, the functional module is upgraded, and a new command is added after the upgrade. The number of byte blocks required for the new command is 600. At this time, since there are no continuous 600 byte blocks available, the newly added command cannot be used normally. At this time, it is necessary to adjust the byte blocks occupied by the previous two commands. The byte blocks occupied by the second command can be adjusted to the byte blocks from 3100 to 5200, so that the byte blocks after 5200 byte blocks can meet the use of the third command.
[0072] In the present application, since the byte status occupied by each command can be clearly and intuitively seen through the memory occupation status diagram, when updating the byte blocks occupied by the commands, the operator can clearly know which bytes are not occupied and how to adjust the byte blocks occupied by each command memory so that the memory can be reasonably utilized.
[0073] In a specific embodiment, if the update operation is a command modification operation, then the update instruction of the target command is obtained, and the memory occupation byte block of the target command is updated according to the update instruction to form a new memory occupation state diagram, and it also includes: in response to a selection operation in the memory occupation state diagram, erasing the second graphic mark of the corresponding selected position of the selected operation, and drawing a third graphic mark on the corresponding selected position, or covering the second graphic mark of the corresponding selected position of the selected operation with the third graphic mark; wherein the corresponding selected position is the corresponding position of the byte block of the command corresponding to the selection operation.
[0074] It can be understood that if the occupied bytes of the target command are to be modified, the byte block occupied by the target command must first be selected, where Figure 5 As shown, the selection operation can be performed by clicking the byte block position corresponding to the target command in the memory occupation state diagram on the display screen with a mouse or a touch screen. Since the byte blocks occupied by each command are associated, the selection operation can be issued by simply clicking one of the byte blocks occupied by the target command with a mouse or a touch screen. Then, in order to enable the operator to intuitively know the byte block corresponding to the selected command that needs to be modified; in addition, Figure 6 As shown, the selected operation can also directly update the target command in the operation interface by clicking the command with the mouse or touch screen. If the target command is operation command 2, the operation command 2 is clicked by the mouse or touch screen. At this time, the bottom color of operation command 2 changes to indicate that the byte block occupied by operation command 2 needs to be modified. After determining the byte block of the target command to be modified, in the embodiment of the present application, the graphic mark of the corresponding selected position of the selected operation is erased, and a third graphic mark is drawn on the corresponding selected position, so that the operator can intuitively and accurately see which part of the byte block needs to be modified.
[0075] In addition, the third graphic mark can be a graphic mark of a third preset shape with a third color. It can be understood that in order to facilitate the distinction between the first graphic mark, the second graphic mark and the third graphic mark, the third graphic mark can be set to a mark graphic different from the second graphic mark and the first graphic mark. The third graphic mark can be different in color from the second graphic mark and / or the first graphic mark, but the same in shape; the third graphic mark can also be the same color as the first graphic mark and / or the second graphic mark, but different in shape; the third graphic mark can also be different in color and shape from the first graphic mark and / or the second graphic mark, and the color of the third graphic mark must also be different from the color of the gap. In this way, according to the memory occupancy state diagram, it can be clearly known which byte blocks are not occupied, which byte blocks are occupied, and which byte blocks are selected and need to be modified. In the embodiment of the present application, the third graphic mark is represented by a black rectangle.
[0076] If the third graphic mark, the second graphic mark and the first graphic mark have the same graphic shape but different colors, the graphic mark at the selected position corresponding to the selection operation may not be erased, and the third graphic mark may be directly drawn over the second graphic mark at the selected position corresponding to the selection operation.
[0077] In this embodiment, after drawing the third graphic mark at the corresponding selected position, as shown in FIG. Figure 7 As shown, the occupied byte block of the target command is updated according to the update instruction, including:
[0078] Step S210, obtaining the memory occupied byte block interval after the target command in the update instruction is modified.
[0079] The memory occupied byte block interval after the target command is modified is the interval from the modified start byte block to the modified end byte block of the target command.
[0080] Step S220, erase the third graphic mark at the corresponding selected position, and draw the first graphic mark at the corresponding selected position, or overwrite the first graphic mark on the third graphic mark at the corresponding selected position; and erase all graphic marks at the corresponding position of the memory occupied byte block interval after the target command is modified, and draw the second graphic mark at the corresponding position of the memory occupied byte block interval after the target command is modified, or overwrite the second graphic mark on the first graphic mark at the corresponding position of the memory occupied byte block interval after the target command is modified.
[0081] Wherein, the second graphic mark corresponding to each command is associated with a setting.
[0082] It can be understood that if the byte block occupied by the target command needs to be modified, when the byte block to be modified is selected in the selection operation, if the selection operation is to select the modified byte block by clicking the byte block corresponding to the target command on the memory occupation state diagram, when the corresponding target command of the memory occupation state diagram is clicked, the command update operation interface below the memory occupation state diagram ( Figure 6) will change color at the same time, so that the operator can clearly see which command is selected; if the target command in the command update operation interface is directly clicked when the operation is selected, the background color of the target command will also change color at this time; in this way, the operator can directly find the operation command that needs to be modified, and then write the modified starting byte block and the modified ending byte block at the starting byte block position and the ending byte block position corresponding to the operation command (target command) respectively. After the processor receives the modified starting byte block and the modified ending byte block for the target command, it can erase all the graphic marks on the corresponding selected position. After erasing, there is currently no command occupying the byte block corresponding to the corresponding selected position. At this time, the first graphic mark needs to be drawn on the corresponding selected position to indicate that these byte blocks are currently not occupied. In addition, if the third graphic mark, the second graphic mark and the first graphic mark have the same graphic shape but different colors, the first graphic mark can be directly drawn on the third graphic mark at the corresponding selected position.
[0083] While drawing the first graphic mark at the corresponding selected position, the first graphic mark at the corresponding position of the byte block interval modified by the target command is erased, and the second graphic mark is drawn at the corresponding position of the byte block interval modified by the target command, thereby completing the modification of the byte block occupied by the target command; or if the third graphic mark, the second graphic mark and the first graphic mark have the same graphic shape but different colors, the second graphic mark is directly drawn over the first graphic mark at the corresponding position of the memory occupied byte block interval modified by the target command, thereby completing the modification of the byte block occupied by the target command.
[0084] In the modification command operation, if you change Figure 8 The byte block occupied by the operation command 3 in the modification is modified. The starting byte block of the operation command 3 before the modification is 29, and the starting byte block after the modification is 40. Fig. 9 As shown, the starting byte block of the operation command 3 is modified to 64, and the ending byte block is modified to 75. Then, in the command update operation interface, 29 is modified to 64 at the starting byte block of the operation command 3, and 40 at the ending byte block is modified to 75. Then, the occupied byte block of the operation command 3 can be modified, and the modified byte occupancy can be displayed on the memory occupation status diagram.
[0085] In another specific embodiment, Fig.10 As shown, if the update operation is a new command operation, the occupied byte block of the target command is updated according to the update instruction, including:
[0086] Step S230, obtaining the occupied byte block interval of the newly added command in the update instruction.
[0087] The byte block interval occupied by the newly added command is the interval from the start byte block of the newly added command to the end byte block of the newly added command.
[0088] Step S240, erase all graphic marks at positions corresponding to the memory byte block interval of the newly added command, and draw a second graphic mark at positions corresponding to the memory byte block interval of the newly added command, or draw the second graphic mark over the first graphic mark at positions corresponding to the memory byte block interval of the newly added command.
[0089] Wherein, the second graphic mark corresponding to each command is associated with a setting.
[0090] It can be understood that if a new operation command needs to be added, the operator can directly perform the new operation in the command update operation interface, and input the starting byte block and the ending byte block of the new command. After the processor receives the starting byte block and the ending byte block of the new command, it erases the graphic mark at the corresponding position of the byte block interval of the new command, and draws the second graphic mark at the corresponding position of the byte block interval of the new command, so that the byte block occupied by the new command can be intuitively displayed on the memory occupancy status diagram. Or if the third graphic mark, the second graphic mark and the first graphic mark have the same graphic shape but different colors, the second graphic mark can also be directly drawn on the first graphic mark at the corresponding position of the memory occupancy byte block interval of the new command.
[0091] In some other specific embodiments, if the update operation is a delete command operation, the occupied byte blocks of the target command are updated according to the update instruction, including: after obtaining the delete instruction for the target command, the command is deleted, and the second graphic mark at the corresponding position of these byte blocks on the memory occupation status diagram is erased, and the first graphic mark is drawn at the corresponding position, or when the graphic shapes of the first graphic mark, the second graphic mark and the third graphic mark are the same but the colors are different, the first graphic mark can be directly drawn on the second graphic mark at the corresponding position of these byte blocks on the memory occupation status diagram, and then the memory occupation status diagram is updated to a new memory occupation status diagram for display.
[0092] In the embodiment of the present application, the command update operation interface also includes refresh, reset, and save reallocated byte block buttons. Among them, the save reallocated byte block button means that after the byte block corresponding to the command is updated, click the save reallocated byte block button to save the updated content. The refresh button is when the memory occupied byte block of a certain command is modified, but the modification is not saved, but it is found inappropriate in subsequent operations and needs to be returned to the state before the modification. The operator selects the current operation command and clicks the refresh button. The state occupied by the current command and the selected state byte block on the memory occupation state diagram are partially updated, and the byte block of the display state (light gray) is drawn. Then, according to the memory occupation data of this command in the initialization state, the byte block of the occupied state (dark gray) is drawn at the specified position to replace the byte block of the display state (light gray). The function of the reset button is that when the memory occupied byte block of one or more commands is modified, the modified data has been saved. During the subsequent operation, it is found that there is a problem with the memory data after the modification. The operator directly clicks the reset button, and the byte blocks of the occupied status of all commands are partially updated and replaced with the display status byte blocks. Then, the occupied byte blocks are redrawn according to the previous memory occupied data to replace the display status byte blocks in the corresponding positions.
[0093] In addition, the command update operation interface of the embodiment of the present application also includes a display memory occupancy button, a reorder button, etc. By clicking the display memory occupancy button, a command to display the memory occupancy is sent to the processor. After calculation, the processor sends the memory occupancy to the display interface for display, and the form can be digital form, bar chart form, or pie chart form, etc. By clicking the reorder button, a reorder command can be sent to the processor, and then the operator can enter the occupied byte block corresponding to each command through the starting byte block position and the ending byte block position of each command in the command update operation interface, and then the memory can be reordered and displayed after sorting.
[0094] In an embodiment of the present application, when the memory status is displayed through a memory occupancy status diagram, it is displayed through one cell at a time, which can be understood as a virtual canvas. Each byte block is represented by a drawn graphic. When modifying the occupancy status of a byte block, it is only necessary to partially erase the modified byte block and draw a corresponding mark at the specified byte block position. Similarly, when adding a new command, it is only necessary to draw a second graphic mark at the corresponding position of the byte block occupied by the new command. It can be understood that the present application adopts this drawing method. When updating the memory, only the updated part needs to be operated, and other byte blocks do not need to be processed, and the resource consumption is small, which will not cause the processing system to freeze or crash.
[0095] The present application can draw and display the initial memory occupancy status diagram through the total number of memory byte blocks, the preset base, and the initial memory byte block interval occupied by each command. Then, when the command needs to be updated, it is only necessary to erase and draw the byte blocks occupied by the updated command. The method of the present application can intuitively display which byte blocks in the memory are occupied, and can intuitively display the specific byte block interval occupied by each command, so that the operator can clearly understand the memory occupancy so that the memory space can be reasonably used. And when the operator adjusts the memory occupancy, the operator can also see the actual operation status according to the memory occupancy status diagram. Fig.11 A schematic diagram of the structure of a memory display device according to an embodiment of the present application is shown. Exemplarily, the memory display device includes:
[0096] The memory occupancy status diagram forming module 100 is used to draw and display a memory occupancy status diagram according to the total number of memory byte blocks occupied by all commands, a preset base and the interval of the memory byte blocks occupied by each command; wherein the display content of the memory occupancy status diagram includes unoccupied byte blocks and the memory byte blocks occupied by each command.
[0097] The memory occupancy state diagram updating module 200 is used to obtain the update instruction of the target command when updating the memory byte block occupied by any command, and update the graphic mark of the memory occupancy byte block of the target command according to the update instruction to form a new memory occupancy state diagram.
[0098] It can be understood that the device of this embodiment corresponds to the memory display method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0099] The present application also provides a computer-readable storage medium for storing the computer program used in the above electronic device. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0100] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0101] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0102] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0103] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A memory display method, characterized in that: include: Draw and display a memory occupancy status diagram according to the total number of memory byte blocks occupied by all commands, a preset base and the interval of the memory byte blocks occupied by each command; wherein the display content of the memory occupancy status diagram includes unoccupied byte blocks and memory byte blocks occupied by each command; When updating the memory byte block occupied by any of the commands, an update instruction of the target command is obtained, and the graphic mark of the memory occupied byte block of the target command is updated according to the update instruction to form a new memory occupation state diagram.
2. The memory display method according to claim 1, characterized in that: The method of drawing and displaying a memory occupancy state diagram according to the total number of memory byte blocks occupied by all commands, the preset base and the interval of the memory byte blocks occupied by each command includes: Based on the total number of memory byte blocks occupied by all commands and the preset base, a memory arrangement diagram is drawn according to a preset arrangement rule; wherein the corresponding position of each byte block in the memory arrangement diagram is initially drawn with a first graphic mark, and gaps are left between the corresponding positions of adjacent byte blocks; Based on the interval of the memory occupied byte block of each command, the first graphic mark at the corresponding position of the memory occupied byte block of the corresponding command in the memory arrangement diagram is erased, and a second graphic mark is redrawn at the corresponding position of the memory occupied byte block of the corresponding command to form the memory occupancy status diagram and display it; wherein the interval of the memory occupied byte block of each command is determined by the starting byte block and the ending byte block of each command.
3. The memory display method according to claim 2, characterized in that: The step of drawing a memory arrangement diagram based on the total number of memory byte blocks occupied by all commands and a preset base and according to a preset arrangement rule includes: The number of rows and columns to be drawn is determined according to the total number of memory byte blocks and the preset base value; wherein the number of rows is the total number of memory byte blocks divided by the preset base value and rounded to an integer. If there is no remainder after rounding, the number of rows is the rounded number; if there is a remainder after rounding, the number of rows is the rounded number plus 1; the number of columns is equal to the preset base value; According to the number of rows and the number of columns of each byte block, the corresponding position of each byte block is determined, and the first graphic mark is drawn at the corresponding position of each byte block to form the memory arrangement diagram; wherein, if there is a remainder after rounding, the remainder of the first graphic marks is drawn in the last row.
4. The memory display method according to claim 3, characterized in that: Also includes: A mark number of the byte block at the beginning of the corresponding row is set in a blank area adjacent to the first column of the memory occupancy status diagram; wherein the mark number is a sequence number of the byte block at the beginning of the corresponding row expressed in a preset base.
5. The memory display method according to claim 2, characterized in that: If the update operation is a modify command operation, the step of obtaining the update instruction of the target command and updating the memory occupied byte block of the target command according to the update instruction to form a new memory occupied state diagram further includes: In response to a selection operation in the memory occupancy status diagram, the second graphic mark of the selected position corresponding to the selection operation is erased, and a third graphic mark is drawn on the corresponding selected position, or the third graphic mark is drawn over the second graphic mark of the corresponding selected position of the selection operation; wherein the corresponding selected position is the corresponding position of the byte block of the corresponding command of the selection operation.
6. The memory display method according to claim 5, characterized in that: The updating of the graphic mark of the memory occupied byte block of the target command according to the update instruction comprises: Obtaining the memory occupied byte block interval after the target command in the update instruction is modified; wherein the memory occupied byte block interval after the target command is modified is the interval from the modified start byte block to the modified end byte block of the target command; Erasing all the graphic marks at the corresponding selected position, and drawing the first graphic mark at the corresponding selected position, or drawing the first graphic mark over the third graphic mark at the corresponding selected position; All the graphic marks at the corresponding positions of the memory occupied byte block interval after the target command is modified are erased, and the second graphic mark is drawn at the corresponding position of the memory occupied byte block interval after the target command is modified, or the second graphic mark is drawn over the first graphic mark at the corresponding position of the memory occupied byte block interval after the target command is modified; wherein the second graphic mark corresponding to each command is associated with each other.
7. The memory display method according to claim 2, characterized in that: If the update operation is a new command operation, then updating the graphic mark of the memory occupied byte block of the target command according to the update instruction includes: Obtaining the occupied byte block interval of the newly added command in the update instruction; wherein the byte block interval of the newly added command is the interval from the starting byte block of the newly added command to the ending byte block of the newly added command; All the graphic marks at the corresponding positions of the memory occupied byte block interval of the newly added command are erased, and the second graphic mark is drawn at the corresponding position of the memory occupied byte block interval of the newly added command, or the second graphic mark is drawn over the first graphic mark at the corresponding position of the memory occupied byte block interval of the newly added command; wherein the second graphic mark corresponding to each command is associated with each other.
8. A memory display device, characterized in that: include: A memory occupancy state diagram forming module, used to draw and display a memory occupancy state diagram according to the total number of memory byte blocks occupied by all commands, a preset base and the interval of the memory byte blocks occupied by each command; wherein the display content of the memory occupancy state diagram includes unoccupied byte blocks and memory byte blocks occupied by each command; The memory occupancy status graph update module is used to obtain the update instruction of the target command when updating the memory byte block occupied by any of the commands, and update the graphic mark of the memory occupancy byte block of the target command according to the update instruction to form a new memory occupancy status graph.
9. An electronic device, characterized in that: The electronic device includes a display interface, a processor and a memory, the memory stores a computer program, the processor is used to execute the computer program to implement the memory display method described in any one of claims 1-7; the display interface is used to display the processing results of the memory by the processor.
10. A computer-readable storage medium, characterized in that: A computer program is stored therein, and when the computer program is executed on a processor, the memory display method according to any one of claims 1 to 7 is implemented.
