CN117631952A - Coding method, device and electronic equipment - Google Patents

Coding method, device and electronic equipment Download PDF

Info

Publication number
CN117631952A
CN117631952A CN202210959498.9A CN202210959498A CN117631952A CN 117631952 A CN117631952 A CN 117631952A CN 202210959498 A CN202210959498 A CN 202210959498A CN 117631952 A CN117631952 A CN 117631952A
Authority
CN
China
Prior art keywords
storage area
writing
bit value
electronic equipment
erasing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210959498.9A
Other languages
Chinese (zh)
Inventor
谢明璞
王勇
赵丽红
吴振志
吴涵渠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Aoto Electronics Co Ltd
Original Assignee
Shenzhen Aoto Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Aoto Electronics Co Ltd filed Critical Shenzhen Aoto Electronics Co Ltd
Priority to CN202210959498.9A priority Critical patent/CN117631952A/en
Priority to PCT/CN2023/103929 priority patent/WO2024032217A1/en
Publication of CN117631952A publication Critical patent/CN117631952A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Abstract

The application relates to the technical field of data processing, and discloses a coding method, a coding device and electronic equipment, wherein the coding method comprises the following steps: acquiring a first storage area and a second storage area; when the electronic equipment is initialized, the first storage area and the second storage area are erased, so that the bit values of the first storage area and the second storage area are 1; when the electronic equipment runs for a preset time, writing the bit value of the first storage area from 1 to 0; when all bit values of the first storage area are 0, erasing the first storage area so that all bit values of the first storage area are written from 0 to 1; the bit value of the second storage area is written from 1 to 0, and the method and the device utilize the characteristic that the running time monotonically increases, and can greatly reduce the operation times of the storage medium by the coding mode, so that the service life of the storage medium for recording the running time of the electronic equipment is prolonged.

Description

Coding method, device and electronic equipment
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a coding method, a coding device, and an electronic device.
Background
Along with the continuous development of science and technology, the market is higher and higher to the life requirement of LED display screen lamp plate module. The LED display screen lamp panel module needs to record the total live running time of the equipment after self-production, and the traditional recording mode is that the total live running time of the equipment is written into a non-power-down volatile storage medium at regular time.
Because the nonvolatile storage media such as Flash, EEPROM and the like have the limit of erasing operation times, if the operation time writing operation is frequently carried out, the service life of the storage media is accelerated to expire, thereby influencing the service life of the equipment.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a coding method, a coding device, and an electronic device, which can improve the service life of a storage medium for recording the live running time of the electronic device.
In a first aspect, embodiments of the present application provide an encoding method, the method including:
acquiring a first storage area and a second storage area;
erasing the first storage area and the second storage area when the electronic device is initialized, so that the bit values of the first storage area and the second storage area are 1;
when the electronic equipment runs for a preset time, writing the bit value of the first storage area from 1 to 0;
erasing the first storage area when all bit values of the first storage area are 0, so that all bit values of the first storage area are written from 0 to 1;
writing the bit value of the second storage area from 1 to 0.
In some embodiments, the writing the bit value of the first storage area from 1 to 0 when the electronic device is running for a preset time includes:
and when the electronic equipment runs for a preset time, sequentially writing the lowest bit value in the first storage area from 1 to 0.
In some embodiments, said writing said bit value of said second storage area from 1 to 0 comprises:
and sequentially writing the lowest bit value in the second storage area from 1 to 0.
In some embodiments, the first storage area is a data low-order area of high frequency operation.
In some embodiments, the second storage area is a data high-order area of low frequency operation.
In a second aspect, embodiments of the present application further provide an encoding apparatus, where the apparatus includes:
the acquisition module is used for acquiring the first storage area and the second storage area;
the first erasing module is used for erasing the first storage area and the second storage area when the electronic equipment is initialized so that the bit value of the first storage area and the second storage area is 1;
the first writing module is used for writing the bit value of the first storage area from 1 to 0 when the electronic equipment runs for a preset time;
the second erasing module is used for erasing the first storage area when all bit values of the first storage area are 0, so that all bit values of the first storage area are written from 0 to 1;
and the second writing module is used for writing the bit value of the second storage area from 1 to 0.
In some embodiments, the first writing module is specifically configured to:
and when the electronic equipment runs for a preset time, sequentially writing the lowest bit value in the first storage area from 1 to 0.
In some embodiments, the second writing module is specifically configured to:
and sequentially writing the lowest bit value in the second storage area from 1 to 0.
In some embodiments, the first storage area is a data low-order area of high frequency operation.
In some embodiments, the second storage area is a data high-order area of low frequency operation.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
In a fourth aspect, embodiments of the present application also provide a non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by a processor, cause the processor to perform the method of the first aspect.
Compared with the prior art, the beneficial effects of this application are: different from the situation in the prior art, the encoding method provided by the embodiment of the application obtains the first storage area and the second storage area; then, when the electronic equipment is initialized, the first storage area and the second storage area are erased so that the bit values of the first storage area and the second storage area are 1; then when the electronic equipment runs for a preset time, writing the bit value of the first storage area from 1 to 0; further, when all bit values of the first storage area are 0, the first storage area is erased, so that all bit values of the first storage area are written from 0 to 1, and the bit values of the second storage area are written from 1 to 0.
Drawings
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements, and in which the figures of the drawings are not to be taken in a limiting sense, unless otherwise indicated.
FIG. 1 is a flow chart of an encoding method provided in one embodiment of the present application;
FIG. 2 is a schematic diagram of an encoding apparatus provided in one embodiment of the present application;
fig. 3 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that, if not conflicting, the various features in the embodiments of the present application may be combined with each other, which is within the protection scope of the present application. In addition, while functional block division is performed in a device diagram and logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart. Moreover, the words "first," "second," "third," and the like as used herein do not limit the data and order of execution, but merely distinguish between identical or similar items that have substantially the same function and effect.
As shown in fig. 1, an embodiment of the present application provides an encoding method, which includes:
step 102, acquiring a first storage area and a second storage area.
In the embodiment of the application, first, 2 first storage areas and second storage areas which can be independently erased are selected from the storage medium. Specifically, the first storage area is a data low-order area for high-frequency operation, and the second storage area is a data high-order area for low-frequency operation. The storage medium may be Flash, for example.
Step 104, when the electronic device is initialized, erasing the first storage area and the second storage area so that the bit values of the first storage area and the second storage area are 1.
When the electronic device is initialized, the first storage area and the second storage area of the storage medium are erased, specifically, the first storage area and the second storage area can be erased by adopting an existing erasing mode, so that bit values of the first storage area and the second storage area are all 1. Further, in the first storage area and the second storage area, all the bit numbers with the value of 0 are the code numbers. When the erasure is just completed, the initial state of the area is the initial state, and at this time, all the stored bit values in the area are all 1, and no bit with the value of 0 represents the code of 0.
And 106, when the electronic equipment runs for a preset time, writing the bit value of the first storage area from 1 to 0.
In the embodiment of the present application, the preset time may be a time interval, for example, the preset time is 1 minute. And when the electronic equipment runs for a preset time, writing the bit value of the first storage area from 1 to 0. Specifically, every time the electronic device is powered on for one minute, the lowest one bit value in the first storage area is written from 1 to 0 in turn. Illustratively, bytes 0xff- >0xfe- >0xfc- >0xf8- >0xf0- >0xe0- >0xc0- >0x80- >0x00, when the electronic device is running for one minute, then writing from bytes with an address of 0, writing bytes with an address of 0 from 0xff to 0xfe, the first storage area has 1 bit with a value of 0.
And step 108, when all bit values of the first storage area are 0, erasing the first storage area so that all bit values of the first storage area are written from 0 to 1.
Step 110, writing the bit value of the second storage area from 1 to 0.
When the subsequent codes are increased, the bit values in the area are written from 1 to 0 according to the address and bit sequence until all the bit values in the area are written to 0, when all the bit values in the first storage area are 0, the first storage area is erased, so that all the bit values in the first storage area are written from 0 to 1, and then the bit values in the second storage area are written from 1 to 0. Specifically, the lowest bit value in the second storage area is written from 1 to 0 in sequence. Further, when all bit values of the second storage area are 0, the second storage area is erased, so that all bit values of the second storage area are written from 0 to 1, and steps 104 to 110 are circularly executed until the maximum erasing times are reached.
According to the encoding method, the first storage area and the second storage area are acquired; then, when the electronic equipment is initialized, the first storage area and the second storage area are erased so that the bit values of the first storage area and the second storage area are 1; then when the electronic equipment runs for a preset time, writing the bit value of the first storage area from 1 to 0; further, when all bit values of the first storage area are 0, the first storage area is erased, so that all bit values of the first storage area are written from 0 to 1, and the bit values of the second storage area are written from 1 to 0.
Accordingly, the embodiment of the present application further provides an encoding apparatus 200, as shown in fig. 2, the apparatus 200 includes:
an acquiring module 202, configured to acquire a first storage area and a second storage area;
a first erasing module 204, configured to erase the first storage area and the second storage area when the electronic device is initialized, so that a bit value of the first storage area and the second storage area is 1;
a first writing module 206, configured to write the bit value of the first storage area from 1 to 0 when the electronic device is running for a preset time;
a second erasing module 208, configured to erase the first storage area when all bit values of the first storage area are 0, so that all bit values of the first storage area are written from 0 to 1;
a second writing module 210, configured to write the bit value of the second storage area from 1 to 0.
According to the encoding device provided by the embodiment of the application, the first storage area and the second storage area are acquired through the acquisition module; then when the electronic equipment is initialized, the first storage area and the second storage area are erased through a first erasing module, so that the bit values of the first storage area and the second storage area are 1; then when the electronic equipment runs for a preset time, writing the bit value of the first storage area from 1 to 0 through a first writing module; further, when all bit values of the first storage area are 0, the first storage area is erased through the second erasing module, so that all bit values of the first storage area are written from 0 to 1, and the bit values of the second storage area are written from 1 to 0 through the second writing module.
Optionally, in other embodiments of the apparatus, as shown in fig. 2, the first writing module 206 is specifically configured to:
and when the electronic equipment runs for a preset time, sequentially writing the lowest bit value in the first storage area from 1 to 0.
Optionally, in other embodiments of the apparatus, as shown in fig. 2, the second writing module 120 is specifically configured to:
and sequentially writing the lowest bit value in the second storage area from 1 to 0.
Optionally, in other embodiments of the apparatus, the first storage area is a data low-order area of high frequency operation.
Optionally, in other embodiments of the apparatus, the second storage area is a data high-order area of low frequency operation.
It should be noted that, the above-mentioned encoding device may execute an encoding method provided by the embodiments of the present application, and have corresponding functional modules and beneficial effects of the execution method, and technical details described in the embodiments of the encoding device are not shown in detail, and may refer to an encoding method provided by the embodiments of the present application.
Fig. 3 is a schematic hardware structure of an electronic device according to an embodiment of the present application, as shown in fig. 3, an electronic device 300 includes:
one or more processors 301, one processor being illustrated in fig. 3, and a memory 302.
The processor 301 and the memory 302 may be connected by a bus or otherwise, for example in fig. 3.
The memory 302 is used as a non-volatile computer readable storage medium for storing non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions/modules corresponding to the encoding methods in the embodiments of the present application. The processor 301 executes various functional applications of the electronic device and data processing, that is, implements the encoding method of the above-described method embodiments, by running nonvolatile software programs, instructions, and modules stored in the memory 302.
Memory 302 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the encoding apparatus, and the like. In addition, memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 302 may optionally include memory located remotely from processor 301, which may be connected to the encoding device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Embodiments also provide a non-transitory computer readable storage medium storing computer executable instructions that, when executed by one or more processors, cause the one or more processors to perform the encoding method of any of the method embodiments described above.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
From the above description of embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus a general purpose hardware platform, or may be implemented by hardware. Those skilled in the art will appreciate that all or part of the processes implementing the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and where the program may include processes implementing the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; the technical features of the above embodiments or in the different embodiments may also be combined under the idea of the present application, the steps may be implemented in any order, and there are many other variations of the different aspects of the present application as described above, which are not provided in details for the sake of brevity; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method of encoding, the method comprising:
acquiring a first storage area and a second storage area;
erasing the first storage area and the second storage area when the electronic device is initialized, so that the bit values of the first storage area and the second storage area are 1;
when the electronic equipment runs for a preset time, writing the bit value of the first storage area from 1 to 0;
erasing the first storage area when all bit values of the first storage area are 0, so that all bit values of the first storage area are written from 0 to 1;
writing the bit value of the second storage area from 1 to 0.
2. The encoding method according to claim 1, wherein writing the bit value of the first storage area from 1 to 0 when the electronic device is operated for a preset time, comprises:
and when the electronic equipment runs for a preset time, sequentially writing the lowest bit value in the first storage area from 1 to 0.
3. The encoding method according to claim 2, wherein said writing said bit value of said second storage area from 1 to 0 comprises:
and sequentially writing the lowest bit value in the second storage area from 1 to 0.
4. A coding method according to any of claims 1-3, characterized in that the first storage area is a data low-order area of high frequency operation.
5. A coding method according to any of claims 1-3, characterized in that the second storage area is a data high-order area operating at low frequencies.
6. An encoding apparatus, the apparatus comprising:
the acquisition module is used for acquiring the first storage area and the second storage area;
the first erasing module is used for erasing the first storage area and the second storage area when the electronic equipment is initialized so that the bit value of the first storage area and the second storage area is 1;
the first writing module is used for writing the bit value of the first storage area from 1 to 0 when the electronic equipment runs for a preset time;
the second erasing module is used for erasing the first storage area when all bit values of the first storage area are 0, so that all bit values of the first storage area are written from 0 to 1;
for writing said bit value of said second storage area from 1 to 0.
7. The encoding device according to claim 6, wherein the first writing module is specifically configured to:
and when the electronic equipment runs for a preset time, sequentially writing the lowest bit value in the first storage area from 1 to 0.
8. The encoding device according to claim 7, wherein the second writing module is specifically configured to:
and sequentially writing the lowest bit value in the second storage area from 1 to 0.
9. An electronic device, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
10. A non-transitory computer readable storage medium storing computer executable instructions which, when executed by a processor, cause the processor to perform the method of any of claims 1-5.
CN202210959498.9A 2022-08-11 2022-08-11 Coding method, device and electronic equipment Pending CN117631952A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210959498.9A CN117631952A (en) 2022-08-11 2022-08-11 Coding method, device and electronic equipment
PCT/CN2023/103929 WO2024032217A1 (en) 2022-08-11 2023-06-29 Coding method and apparatus, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210959498.9A CN117631952A (en) 2022-08-11 2022-08-11 Coding method, device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117631952A true CN117631952A (en) 2024-03-01

Family

ID=89850667

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210959498.9A Pending CN117631952A (en) 2022-08-11 2022-08-11 Coding method, device and electronic equipment

Country Status (2)

Country Link
CN (1) CN117631952A (en)
WO (1) WO2024032217A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101800222A (en) * 2010-02-05 2010-08-11 上海宏力半导体制造有限公司 Masking read-only memory
CN102054186B (en) * 2010-12-17 2013-08-21 深圳市远望谷信息技术股份有限公司 Information encoding method and device for electronic tag
US20190068981A1 (en) * 2017-08-23 2019-02-28 Qualcomm Incorporated Storing and retrieving lossy-compressed high bit depth image data
CN109508252B (en) * 2017-09-15 2022-03-01 群联电子股份有限公司 Data coding method, memory control circuit unit and memory storage device
CN114333965B (en) * 2020-09-30 2023-09-08 长鑫存储技术有限公司 Memory and test method thereof

Also Published As

Publication number Publication date
WO2024032217A1 (en) 2024-02-15

Similar Documents

Publication Publication Date Title
US10310772B2 (en) Memory control method and memory control apparatus
CN104156414A (en) Terminal, device and method for clearing junk files
CN103324507A (en) Method and apparatus for updating terminal preset application program
CN110870287B (en) Over-the-air (OTA) update of partially compressed firmware
KR100746198B1 (en) Apparatus and method for storing data, and readable recording medium thereof
US11249677B2 (en) Method and apparatus for erasing or writing flash data
US20190220272A1 (en) Binary image differential patching
CN114063906B (en) Management method and device for physical blocks in NAND flash memory and SSD (solid State disk) equipment
CN117631952A (en) Coding method, device and electronic equipment
CN116185563B (en) Software simulation algorithm based on vehicle-gauge microcontroller data flash memory
CN110968351A (en) BIOS configuration method and device
CN103730099A (en) Backlight intensity adjusting method and electronic device
US20100271884A1 (en) Communication device and method for erasing data from a communication device
CN110990640B (en) Data determination method, device, equipment and computer readable storage medium
CN110851433A (en) Key optimization method for key value storage system, storage medium, electronic device and system
CN111625254B (en) File processing method, device, terminal and storage medium
CN114302427A (en) Configuration parameter updating method and device and related equipment
CN110675910A (en) SSD wear leveling mechanism test method, system, medium and terminal
CN108008981B (en) Method and device for initializing program in system on chip (SoC)
CN112181316A (en) Data block information inheritance method and device, storage medium and electronic equipment
CN106681914B (en) Television picture quality debugging method and device
CN111290765A (en) Firmware fast burning method, system and storage medium
CN110597700A (en) Server testing method and device
CN104932831A (en) Serial NAND flash memory and management method for managing built-in variable bad sectors of serial NAND flash memory
CN110618824A (en) Software upgrading method, device, medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination