CN110147330A - A kind of caching method of character pattern data, device, equipment and storage medium - Google Patents

A kind of caching method of character pattern data, device, equipment and storage medium Download PDF

Info

Publication number
CN110147330A
CN110147330A CN201910435174.3A CN201910435174A CN110147330A CN 110147330 A CN110147330 A CN 110147330A CN 201910435174 A CN201910435174 A CN 201910435174A CN 110147330 A CN110147330 A CN 110147330A
Authority
CN
China
Prior art keywords
target
character
index value
pattern data
cache unit
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.)
Granted
Application number
CN201910435174.3A
Other languages
Chinese (zh)
Other versions
CN110147330B (en
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 Skyworth Software Co Ltd
Original Assignee
Shenzhen Skyworth Software 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 Skyworth Software Co Ltd filed Critical Shenzhen Skyworth Software Co Ltd
Priority to CN201910435174.3A priority Critical patent/CN110147330B/en
Publication of CN110147330A publication Critical patent/CN110147330A/en
Application granted granted Critical
Publication of CN110147330B publication Critical patent/CN110147330B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The embodiment of the invention discloses a kind of caching method of character pattern data, device, equipment and storage mediums, this method comprises: obtaining the corresponding target character pattern data of target character;It regard the corresponding target character coding of target character as element subscript value, obtains target character in default array of indexes and encode corresponding object element position;It determines that target character encodes corresponding target index value, and target index value is stored to object element position;Target cache unit is determined according to target index value, and target character pattern data is stored into target cache unit.Technical solution through the embodiment of the present invention can sufficiently and reasonably utilize memory source, and reduce memory headroom.

Description

A kind of caching method of character pattern data, device, equipment and storage medium
Technical field
The present embodiments relate to caching technology more particularly to a kind of caching method of character pattern data, device, equipment and deposit Storage media.
Background technique
In embedded systems, it usually needs cache the corresponding character pattern data of character, to save central processing Device CPU (Central Processing Unit) resource improves display efficiency.
In the prior art, usually by the corresponding Unicode Unicode of character directly as the index value of character pattern data, this When type matrix memory block be a sequence list in strict conformity with Unicode coded sequence, thus cache and extract character pattern data when Can positioning directly be indexed using the Unicode coding of character.However this cache way needs very big memory Support, than the Mongol character for supporting 0x18AF if necessary, then needs at least 0x18AF type matrix cache unit.It is directed to This, additionally uses a kind of hashing algorithm in the prior art to save memory headroom, specifically: for font size less than or equal to 24 The corresponding index value of the character is set Unicode encoded radio and 0x7FF's and operation values by character;24 are greater than for font size Character, set Unicode encoded radio and 0x1FF's and operation values for the corresponding index value of the character.
Although can suitably reduce the use of memory headroom by above-mentioned hash operations, font size is less than or is waited In 24 character, character that is 5 high, and being greater than 24 for font size is encoded equal to Unicode is had ignored, is even more had ignored Unicode is encoded 7 high, so that a cache unit may correspond to multiple Unicode codings, to can have caching punching It is prominent, and since the Unicode of actual use coding is discontinuous, to be also resulted in there are cache conflict Many cache units are blank, cause the waste of memory source.
Summary of the invention
The embodiment of the invention provides a kind of caching method of character pattern data, device, equipment and storage mediums, existing to solve There is the problem of cache conflict present in technology and memory source waste, sufficiently and reasonably utilizes memory source, and reduce Memory headroom.
In a first aspect, the embodiment of the invention provides a kind of caching methods of character pattern data, comprising:
Obtain the corresponding target character pattern data of target character;
It regard the corresponding target character coding of the target character as element subscript value, obtains described in default array of indexes Target character encodes corresponding object element position;
It determines that the target character encodes corresponding target index value, and the target index value is stored to the target Element position;
Target cache unit is determined according to the target index value, and the target character pattern data is stored to the target In cache unit.
Second aspect, the embodiment of the invention also provides a kind of buffer storages of character pattern data, comprising:
Target character pattern data obtains module, for obtaining the corresponding target character pattern data of target character;
Object element position obtains module, for regarding the corresponding target character coding of the target character as element subscript Value obtains target character described in default array of indexes and encodes corresponding object element position;
Target index value memory module, for determining that the target character encodes corresponding target index value, and will be described Target index value is stored to the object element position;
Target character pattern data memory module, for determining target cache unit according to the target index value, and will be described Target character pattern data is stored into the target cache unit.
The third aspect, the embodiment of the invention also provides a kind of equipment, the equipment includes:
One or more processors;
Memory, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing Device realizes the caching method such as character pattern data provided by any embodiment of the invention.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer Program realizes the caching method such as character pattern data provided by any embodiment of the invention when the program is executed by processor.
The embodiment of the present invention is by using the corresponding character code of each character as element subscript value, establishing one in advance in advance If array of indexes, the corresponding index value of character pattern data each to be cached is stored to preset array of indexes using this.It is obtaining After target character pattern data wait cache, it regard the corresponding target character coding of target character as element subscript value, obtains default rope Target character encodes corresponding object element position in argument group, and determines that target character encodes corresponding target index value, will Target index value stores the object element position into default array of indexes;Target cache unit is determined according to target index value, And target character pattern data is stored into target cache unit.It is fixed by being indexed using the index value in default array of indexes Position, can character quantity according to actual needs distribute the quantity of cache unit, to guarantee the corresponding type matrix number of each character It is stored according to by a corresponding cache unit, the problem of so as to avoid cache conflict, and without to being actually not required to The problem of character wanted also distributes cache unit, wastes so as to avoid memory source realizes the abundant reasonable of memory source It utilizes, reduces memory headroom.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the caching method for character pattern data that the embodiment of the present invention one provides;
Fig. 2 is a kind of example cached using default array of indexes involved in the embodiment of the present invention one;
Fig. 3 is a kind of flow chart of the caching method of character pattern data provided by Embodiment 2 of the present invention;
Fig. 4 is a kind of example of first order table and second level table involved in the embodiment of the present invention two;
Fig. 5 is a kind of structural schematic diagram of the buffer storage for character pattern data that the embodiment of the present invention three provides;
Fig. 6 is a kind of structural schematic diagram for equipment that the embodiment of the present invention four provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is a kind of flow chart of the caching method for character pattern data that the embodiment of the present invention one provides, and the present embodiment can fit For the case where the character pattern data to character caches, particularly in embedded systems, to vector character The scene that is cached of character pattern data.This method can be executed by the buffer storage of character pattern data, which can be by soft The mode of part and/or hardware is realized, is integrated in the equipment with caching function.This method specifically includes the following steps:
S110, the corresponding target character pattern data of target character is obtained.
Wherein, target character can refer to character corresponding to character pattern data to be cached.Character in the present embodiment can To refer to but be not limited to dot character or vector character, wherein dot character is to indicate character using the actual situation of pixel Profile;Vector character is the font that character is described by mathematic curve, and it is borderline that mathematic curve information may include font Key point, derivative information of line etc..Target character pattern data, which can be, refers to the corresponding character pattern data to be cached of target character.
Specifically, the present embodiment can determine target character pattern data from dot character library file or vector font library file. Illustratively, when needing displaying target character on the display interface of equipment, it is possible to specify ruler to be shown needed for target character The characteristic parameters such as very little, type, such as overstriking, inclination, vector engine can be according to these characteristic parameters from vector font library file It extracts corresponding mathematic curve information, and scheduled mathematical operation is carried out to the mathematic curve information of extraction to render, from And the corresponding target character pattern data of target character can be obtained.Or target can also be directly extracted from dot character library file The corresponding target character pattern data of character.
S120, it regard the corresponding target character coding of target character as element subscript value, obtains mesh in default array of indexes Mark the corresponding object element position of character code.
Wherein, target character coding, which can be, refers to the corresponding Unicode coding of target character, so as to utilize Unicode encodes to distinguish each character in language not of the same race, realizes across language, cross-platform text conversion, such as West The corresponding Unicode coding range of that text: 0x0400-0x052F, wherein " 0x " indicates hexadecimal.The number of default array of indexes The character quantity of group size support according to required for business predefines.The present embodiment can use character code as pre- If the subscript value of array of indexes, element position corresponding to each subscript value can be used for storing corresponding to corresponding character pattern data Index value.It should be noted that each element position in default array of indexes is not deposited when establishing default array of indexes Store up effective index value, index value be during caching character pattern data, real-time perfoming storage.
Specifically, the coding of target character corresponding to target character is obtained, and in default array of indexes, by target character Coding is determined as object element position as element position corresponding to subscript value.For example, target character is encoded to 0x0020, then Show that object element position is the element position that subscript value is 32 in default array of indexes.
S130, it determines that target character encodes corresponding target index value, and target index value is stored to object element position It sets.
Wherein, index value can be the numerical value of the storage location for indexing positioning character pattern data.Target index value can be with It is the numerical value for indexing the storage location of the corresponding target character pattern data of target character coding.Index value in the present embodiment It can refer to a numerical value double byte and greater than zero.Double byte can maximum corresponding 65535 index values, so as to Each character pattern data needed for index business.Correspondingly, the size for presetting array of indexes is the actually used maximum arrived of business Character code multiplied by 2 obtained calculated results.For example, the last one before business item needs support East Asia character Character code, i.e. 0x2FFF then preset the size of array of indexes are as follows: 0x3000 × 2=24576 byte.It should be noted that Each element when initial in default array of indexes is 0, i.e., the corresponding index of not stored any character in default array of indexes Value.
Specifically, the present embodiment randomly can distribute an index value for each character code, can also be based on character Storage order, sequentially be each character code distribute an index value, in order to quick indexing positioning.Determining mesh After marking the corresponding target index value of character code, which can be stored to object element position, so as to When the subscript value of default array of indexes is that target character encodes, the element of acquisition is target index value.
Illustratively, set the goal the corresponding target index value of character code really in S130, if may include: current preset Index value is not present in array of indexes, then target character is encoded into corresponding target index value and is determined as 1;If current preset indexes There are index values in array, then obtain the maximum index value in current preset array of indexes, and maximum index value is added 1, obtain Calculated result be determined as target character and encode corresponding target index value.
Specifically, the present embodiment can determine the corresponding index value of each character in real time, i.e., index value can since 1, Every to need to store a character pattern data, corresponding index value adds up 1 automatically.In default array of indexes, all items need to prop up Index value corresponding to the character held is all larger than 0, and element position corresponding to the character that other not will use is stored as 0. As shown in Fig. 2, " x " in default array of indexes Array indicates that character code is index value corresponding to 0x0020, it can also be with table Show x-th of stored index value.Index value, the i.e. default index number at current time are not present in current preset array of indexes When each element value in group is 0, target index value can be determined as 1.There is index in current preset array of indexes Maximum index value is added 1 there are when non-zero index value, can obtaining maximum index value by value, i.e. current time, acquisition Calculated result is determined as target index value, so as to quickly determine index corresponding to each character data for needing to cache Value.
S140, target cache unit is determined according to target index value, and target character pattern data is stored to target cache list In member.
Wherein, cache unit can refer to the buffer area for storing character pattern data.Each index value and cache unit one One is corresponding, so as to store corresponding character pattern data using each cache unit, so as to avoid in the prior art because same The case where one cache unit stores multiple character pattern datas and leads to cache conflict.
Specifically, the character quantity of the present embodiment support according to required for business predefines the number of cache unit Amount, and the font size information based on character predefines the memory headroom of each cache unit.If the font size than character is 24, i.e., The size of character pattern data is 24 dot matrix, and reserved display area is 24 × 24 pixels, and each pixel needs the transparent of 1 byte It spends, then the memory headroom size of each cache unit are as follows: 24 × 24=576 byte.Illustratively, it is determined according to target index value Target cache unit may include: the corresponding relationship between index value and cache unit according to the pre-stored data, from allocating in advance Each cache unit in determine the corresponding target cache unit of target index value.Wherein, the number of pre-assigned cache unit Amount is equal to the quantity of character, and the memory headroom of cache unit can be predefined according to the font size information of character.The present embodiment exists After character based on support required for business distributes corresponding cache unit, it can establish the corresponding index value of character and caching be single Corresponding relationship between member is simultaneously stored, so as to be based on the corresponding relationship, from pre-assigned all cache units It determines the corresponding target cache unit of target index value, and target character pattern data is stored to target cache unit, realize The caching of character pattern data.Index value is directly made as shown in Fig. 2, the corresponding relationship between index value and cache unit can be For the arrangement order of cache unit.For example, the character pattern data that first cache unit is 1 for storing index value, i.e., first It is buffered the character pattern data of character, so as to the caching sequence based on character come each character pattern data of sequential storage, so as to fast Cached and read promptly character pattern data.
When illustratively, using 24 sign character is stored in the prior art, 2048 characters, required caching are only cached Space are as follows: 24 × 24 × 2048=1179648 byte.And cache way provided by the present embodiment is utilized to store 24 sign characters When, preset the size of array of indexes are as follows: 0x3000 × 2=24576 byte, ordinary business practice project need support most of western language, The actually required quantity for supporting character is 512, i.e., total memory headroom size of all cache units are as follows: 24 × 24 × 512= 294912 bytes, so that required memory headroom has altogether are as follows: 294912+24576=319488 byte.As it can be seen that utilizing this reality Applying cache way provided by embodiment, only 24 font sizes can reduce memory using 1179648-319488=860160 byte, and And the case where character pattern data corresponding to each character is stored, and there is no hash collisions, thus sufficiently and reasonably sharp With memory source, memory headroom is reduced.
The technical solution of the present embodiment, by using the corresponding character code of each character as element subscript value, building in advance A default array of indexes is found, stores the corresponding index of character pattern data each to be cached to preset array of indexes using this Value.After obtaining the target character pattern data wait cache, it regard the corresponding target character coding of target character as element subscript value, obtains Target character in array of indexes must be preset and encode corresponding object element position, and determine that target character encodes corresponding target rope Draw value, target index value is stored to the object element position into default array of indexes;Determine that target is slow according to target index value Memory cell, and target character pattern data is stored into target cache unit.By using the index value in default array of indexes into Line index positioning, can character quantity according to actual needs distribute the quantity of cache unit, to guarantee that each character is corresponding Character pattern data stored by a corresponding cache unit, the problem of so as to avoid cache conflict, and without pair The problem of practical unwanted character also distributes cache unit, wastes so as to avoid memory source, realizes memory source It fully and rationally uses, reduces memory headroom.
It based on the above technical solution, can also include: that acquisition character pattern data to be extracted is corresponding after S140 Character code to be extracted;According to character code to be extracted and default array of indexes, determine that character code to be extracted is corresponding wait mention Take index value;Cache unit to be extracted is determined according to index value to be extracted, and extracts the word to be extracted in cache unit to be extracted Modulus evidence.
Specifically, the present embodiment is when extracting character pattern data, can first will be to be extracted corresponding to character pattern data to be extracted Character code determines index value to be extracted corresponding to character code to be extracted in default array of indexes as subscript value, and can To determine the corresponding cache unit to be extracted of index value to be extracted based on the corresponding relationship between index value and cache unit, So as to extract character pattern data to be extracted from cache unit to be extracted.Actually required each character is equal in the present embodiment It can be cached, so that when showing character direct rapidly extracting character pattern data can be gone out from cache unit, without passing through Vector engine generates character pattern data, substantially increases display efficiency.
Embodiment two
Fig. 3 is a kind of flow chart of the caching method of character pattern data provided by Embodiment 2 of the present invention, and the present embodiment is upper On the basis of stating embodiment, using each cache unit of secondary table structure setting, and based on second level table structure to character pattern data Process of caching is described in detail.Wherein details are not described herein for the explanation of term identical or corresponding with the various embodiments described above.
Referring to Fig. 3, the caching method of character pattern data provided in this embodiment the following steps are included:
S210, the corresponding target character pattern data of target character is obtained.
S220, it regard the corresponding target character coding of target character as element subscript value, obtains mesh in default array of indexes Mark the corresponding object element position of character code.
S230, it determines that target character encodes corresponding target index value, and target index value is stored to object element position It sets.
S240, the corresponding target address pointer of second level table and target sequence number are determined according to target index value.
Wherein, second level table can refer to the caching block being made of the cache unit for presetting element number.The present embodiment In second level table can have an one or more, the quantity for the character that particular number can be shown according to actual needs carries out true It is fixed.The default element number for the cache unit that second level table includes can be determined according to business demand and actual conditions, and And the default element number is less than actually required character quantity, so as to be distributed in real time with the increase of character to be cached Expand buffer area, to realize the dynamic allocation of memory, avoid because allocate in advance memory it is improper due to cause to waste memory or can not The case where normal cache.The corresponding address pointer of each second level table in the present embodiment, so as to quickly navigate to second Grade table.Each cache unit address in each second level table corresponds to second serial number, to distinguish in the table of the second level not Same cache unit.
Specifically, the present embodiment can determine target address pointer and target sequence number according to target index value, so as to Target second level table is determined based on target address pointer, and is determined in the table of the target second level based on target sequence number for delaying Deposit the target cache unit of target character pattern data.
Illustratively, S240 may include: by target index value divided by default element number, and the quotient of acquisition is determined as second The corresponding target address pointer of grade table, and the remainder obtained are determined as the corresponding target sequence number of second level table, wherein default single First quantity refers to the quantity for the cache unit that second level table includes.As shown in figure 4, the A cache unit that each secondary table includes, I.e. default element number is A, and the corresponding serial number of each cache unit is respectively 0 to A-1;The corresponding address of each second level table Pointer, such as first secondary table corresponding address pointer 0, i.e. Index (0- (A-1)).Illustratively, if target index value is 10, presetting element number is 4, then table corresponding target address pointer in the second level is 2, target sequence number 2.
S250, detect whether target address pointer is address blank according to first order table;If so, entering step S260;If It is no, then enter step S270.
Wherein, first order table can be used for storing the corresponding address pointer of each second level table.In first order table eachly Location pointer can correspond to first serial number, to distinguish different address pointers, as shown in Figure 4.
It specifically, can be by whether there is target address pointer in detection first order table, so as to determining target Whether location pointer is address blank.If target address pointer is not present in first order table, show that target address pointer is address blank, The operation of step S260 can be executed at this time.If there are target address pointers in first order table, show target address pointer not It is address blank, there are the corresponding second level tables of target address pointer, can execute the operation of step S270 at this time.
S260, a new second level table is distributed based on target address pointer, and target address pointer is stored to first In grade table, the corresponding cache unit of target sequence number in the second level table currently distributed is determined as target cache unit, is gone forward side by side Enter step S280.
Specifically, when target address pointer is address blank, show all second level tables distributed before current time It has been filled with character pattern data, has needed again that malloc (memory allocation, dynamic memory distribution) one is new at this time Secondary table, and target address pointer is directed toward to the second level table currently distributed, and target address pointer is stored to the first order In table, to carry out content update to first order table.The present embodiment can be using the second level table currently distributed as the target second level Table, and using the corresponding cache unit of target sequence number in the target second level table as target cache unit.
It should be noted that the present embodiment can allocate the second of a first order table and a smaller spatial cache in advance Grade table, second level table gradually distributes later, whenever a second level table has been filled with the one new second level of character pattern data reallocation Table expands type matrix buffer area so as to gradually distribute, without disposably distributing a biggish type matrix buffer area in advance, into one Step adequately and reasonably utilizes memory source, improves the utilization rate of memory.
S270, the corresponding cache unit of target sequence number in the corresponding existing second level table of target address pointer is determined as Target cache unit.
Specifically, when target address pointer is non-address blank, show that there is currently second that target address pointer is directed toward Grade table, i.e., existing second level table, and have in the table of the second level at this currently there is also the cache unit of idle state, at this time may be used It is determined as target cache unit so that this is directly had the corresponding cache unit of target sequence number in the table of the second level.
S280, target character pattern data is stored into target cache unit.
The technical solution of the present embodiment, by the way that each caching is arranged using second level table structure (first order table and second level table) Unit, so as to without accurately calculating all quantity for supporting character of project in advance and allocating type matrix in advance based on the quantity Buffer area, but cache distribute at any time at any time, the space of type matrix buffer area is stepped up using second level table as unit, sufficiently rationally Utilize memory source, further increase memory usage.
It based on the above technical solution, can also include: that acquisition character pattern data to be extracted is corresponding after S280 Character code to be extracted;According to character code to be extracted and default array of indexes, determine that character code to be extracted is corresponding wait mention Take index value;Cache unit to be extracted is determined according to index value to be extracted, and extracts the word to be extracted in cache unit to be extracted Modulus evidence.
Specifically, the present embodiment can be first using character code to be extracted corresponding to character pattern data to be extracted as subscript Value is inquired in default array of indexes with the presence or absence of index value to be extracted corresponding to character code to be extracted, and if it exists, then show Index value to be extracted can be in default element number by buffered character pattern data to be extracted in current cache area at this time, The address pointer to be extracted of acquisition second level table and serial number to be extracted obtain the second level to be extracted based on address pointer to be extracted Table, and using the corresponding cache unit of serial number to be extracted in second level table to be extracted as cache unit to be extracted, so as to Character pattern data to be extracted is extracted, from cache unit to be extracted can quickly to show the word of extraction in the display interface Modulus substantially increases display efficiency according to corresponding character.
It is the embodiment of the buffer storage of character pattern data provided in an embodiment of the present invention, the device and above-mentioned each implementation below The caching method of the character pattern data of example belongs to the same inventive concept, not detailed in the embodiment of the buffer storage of character pattern data The detail content of description, can be with reference to the embodiment of the caching method of above-mentioned character pattern data.
Embodiment three
Fig. 5 is a kind of structural schematic diagram of the buffer storage for character pattern data that the embodiment of the present invention three provides, the present embodiment Be applicable to the case where the character pattern data to character caches, which specifically includes: target character pattern data obtains module 310, object element position obtains module 320, target index value memory module 330 and target character pattern data memory module 340.
Wherein, target character pattern data obtains module 310, for obtaining the corresponding target character pattern data of target character;Target Element position obtains module 320, for regarding the corresponding target character coding of target character as element subscript value, obtains default rope Target character encodes corresponding object element position in argument group;Target index value memory module 330, for determining target character Corresponding target index value is encoded, and target index value is stored to object element position;Target character pattern data memory module 340, for determining target cache unit according to target index value, and target character pattern data is stored into target cache unit.
Optionally, target index value memory module 330 includes: target index value determination unit, is used for: if current preset rope Index value is not present in argument group, then target character is encoded into corresponding target index value and is determined as 1;If current preset index number There are index values in group, then obtain the maximum index value in current preset array of indexes, and maximum index value is added 1, acquisition Calculated result is determined as target character and encodes corresponding target index value.
Optionally, target character pattern data memory module 340 includes: target cache unit determination unit, is used for: according to preparatory Corresponding relationship between the index value and cache unit of storage determines target index value from pre-assigned each cache unit Corresponding target cache unit.
Optionally, the quantity of pre-assigned cache unit is equal to the quantity of character, the memory headroom of cache unit according to The font size information of character predefines.
Optionally, target cache unit determination unit, comprising:
Target information determines subelement, for according to target index value determine the corresponding target address pointer of second level table and Target sequence number;
Target address pointer detection sub-unit, for detecting whether target address pointer is address blank according to first order table;
First object cache unit determines subelement, for if so, distributing one new the based on target address pointer Secondary table, and target address pointer is stored into first order table, the target sequence number in the second level table currently distributed is corresponding Cache unit be determined as target cache unit;
Second target cache unit determines subelement, for if it is not, then by the corresponding existing second level of target address pointer The corresponding cache unit of target sequence number in table is determined as target cache unit.
Optionally, target information determines subelement, is specifically used for: by target index value divided by default element number, obtaining Quotient be determined as the corresponding target address pointer of second level table, and the remainder obtained is determined as the corresponding target sequence of second level table Number, wherein default element number refers to the quantity for the cache unit that second level table includes.
Optionally, the device further include:
Character code to be extracted obtains module, for after storing target character pattern data into target cache unit, Obtain the corresponding character code to be extracted of character pattern data to be extracted;
Index value determining module to be extracted, for determining to be extracted according to character code to be extracted and default array of indexes The corresponding index value to be extracted of character code;
Character pattern data extraction module to be extracted for determining cache unit to be extracted according to index value to be extracted, and extracts Character pattern data to be extracted in cache unit to be extracted.
The buffer storage of character pattern data provided by the embodiment of the present invention can be performed provided by any embodiment of the invention The caching method of character pattern data has the corresponding functional module of caching method and beneficial effect for executing character pattern data.
Example IV
Fig. 6 is a kind of structural schematic diagram for equipment that the embodiment of the present invention four provides.Referring to Fig. 6, which includes:
One or more processors 410;
Memory 420, for storing one or more programs;
When one or more programs are executed by one or more processors 410, so that one or more processors 410 are realized The caching method of the character pattern data as provided by any embodiment in above-described embodiment, this method comprises:
Obtain the corresponding target character pattern data of target character;
It regard the corresponding target character coding of target character as element subscript value, obtains target character in default array of indexes Encode corresponding object element position;
It determines that target character encodes corresponding target index value, and target index value is stored to object element position;
Target cache unit is determined according to target index value, and target character pattern data is stored into target cache unit.
In Fig. 6 by taking a processor 410 as an example;Processor 410 and memory 420 in equipment can by bus or its He connects mode, in Fig. 6 for being connected by bus.
Memory 420 is used as a kind of computer readable storage medium, can be used for storing software program, journey can be performed in computer Sequence and module, if the corresponding program instruction/module of the caching method of the character pattern data in the embodiment of the present invention is (for example, type matrix Target character pattern data in the buffer storage of data obtains module 310, object element position obtains module 320, target index value Memory module 330 and target character pattern data memory module 340).Processor 410 is stored in soft in memory 420 by operation Part program, instruction and module realize above-mentioned type matrix number thereby executing the various function application and data processing of equipment According to caching method.
Memory 420 mainly includes storing program area and storage data area, wherein storing program area can store operation system Application program needed for system, at least one function;Storage data area, which can be stored, uses created data etc. according to equipment.This Outside, memory 420 may include high-speed random access memory, can also include nonvolatile memory, for example, at least one Disk memory, flush memory device or other non-volatile solid state memory parts.In some instances, memory 420 can be into one Step includes the memory remotely located relative to processor 410, these remote memories can pass through network connection to equipment.On The example for stating network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
The caching method for the character pattern data that the equipment and above-described embodiment that the present embodiment proposes propose belongs to same invention structure Think, the technical detail of detailed description not can be found in above-described embodiment in the present embodiment, and the present embodiment has execution type matrix The identical beneficial effect of the caching method of data.
Embodiment five
The present embodiment five provides a kind of computer readable storage medium, is stored thereon with computer program, which is located The caching method realized when device executes such as character pattern data provided by any embodiment of the invention is managed, this method comprises:
Obtain the corresponding target character pattern data of target character;
It regard the corresponding target character coding of target character as element subscript value, obtains target character in default array of indexes Encode corresponding object element position;
It determines that target character encodes corresponding target index value, and target index value is stored to object element position;
Target cache unit is determined according to target index value, and target character pattern data is stored into target cache unit.
The computer storage medium of the embodiment of the present invention, can be using any of one or more computer-readable media Combination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.It is computer-readable Storage medium can be for example but not limited to: electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or Any above combination of person.The more specific example (non exhaustive list) of computer readable storage medium includes: with one Or the electrical connections of multiple conducting wires, portable computer diskette, hard disk, random access memory (RAM), read-only memory (ROM), Erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light Memory device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer readable storage medium can With to be any include or the tangible medium of storage program, the program can be commanded execution system, device or device use or Person is in connection.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including but not limited to: Wirelessly, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
The computer for executing operation of the present invention can be write with one or more programming languages or combinations thereof Program code, described program design language include object oriented program language, such as Java, Smalltalk, C++, also Including conventional procedural programming language-such as " C " language or similar programming language.Program code can be complete It executes, partly executed on the user computer on the user computer entirely, being executed as an independent software package, part Part executes on the remote computer or executes on a remote computer or server completely on the user computer.It is relating to And in the situation of remote computer, remote computer can pass through the network of any kind, including local area network (LAN) or wide area network (WAN), it is connected to subscriber computer, or, it may be connected to outer computer (such as led to using ISP Cross internet connection).
Will be appreciated by those skilled in the art that each module of the above invention or each step can use general meter Device is calculated to realize, they can be concentrated on single computing device, or be distributed in network constituted by multiple computing devices On, optionally, they can be realized with the program code that computer installation can be performed, so as to be stored in storage It is performed by computing device in device, perhaps they are fabricated to each integrated circuit modules or will be more in them A module or step are fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific hardware and The combination of software.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.

Claims (10)

1. a kind of caching method of character pattern data characterized by comprising
Obtain the corresponding target character pattern data of target character;
It regard the corresponding target character coding of the target character as element subscript value, obtains target described in default array of indexes The corresponding object element position of character code;
It determines that the target character encodes corresponding target index value, and the target index value is stored to the object element Position;
Target cache unit is determined according to the target index value, and the target character pattern data is stored to the target cache In unit.
2. the method according to claim 1, wherein determining that the target character encodes corresponding target index Value, comprising:
If index value is not present in current preset array of indexes, the target character is encoded into corresponding target index value and is determined It is 1;
If obtaining the maximum index value in current preset array of indexes there are index value in current preset array of indexes, and will The maximum index value adds 1, and the calculated result of acquisition is determined as the target character and encodes corresponding target index value.
3. the method according to claim 1, wherein determine target cache unit according to the target index value, Include:
Corresponding relationship between index value and cache unit according to the pre-stored data, from pre-assigned each cache unit really Determine the corresponding target cache unit of the target index value.
4. according to the method described in claim 3, it is characterized in that, the quantity of the pre-assigned cache unit is equal to described The memory headroom of the quantity of character, the cache unit is predefined according to the font size information of the character.
5. the method according to claim 1, wherein determine target cache unit according to the target index value, Include:
The corresponding target address pointer of second level table and target sequence number are determined according to the target index value;
Detect whether the target address pointer is address blank according to first order table;
If so, distributing a new second level table based on the target address pointer, and the target address pointer is stored To in the first order table, the corresponding cache unit of the target sequence number in the second level table currently distributed is determined as target Cache unit;
If it is not, then by the corresponding cache unit of the target sequence number in the corresponding existing second level table of the target address pointer It is determined as target cache unit.
6. according to the method described in claim 5, it is characterized in that, determining that second level table is corresponding according to the target index value Target address pointer and target sequence number, comprising:
By the target index value divided by default element number, the quotient of acquisition is determined as the corresponding destination address of second level table and refers to Needle, and the remainder obtained are determined as the corresponding target sequence number of second level table, wherein the default element number refers to described the The quantity for the cache unit that secondary table includes.
7. -6 any method according to claim 1, which is characterized in that store by the target character pattern data to described After in target cache unit, further includes:
Obtain the corresponding character code to be extracted of character pattern data to be extracted;
According to the character code to be extracted and the default array of indexes, determine that the character code to be extracted is corresponding wait mention Take index value;
Determine cache unit to be extracted according to the index value to be extracted, and extract in the cache unit to be extracted it is described to Extract character pattern data.
8. a kind of buffer storage of character pattern data characterized by comprising
Target character pattern data obtains module, for obtaining the corresponding target character pattern data of target character;
Object element position obtains module, for regarding the corresponding target character coding of the target character as element subscript value, It obtains target character described in default array of indexes and encodes corresponding object element position;
Target index value memory module, for determining that the target character encodes corresponding target index value, and by the target Index value is stored to the object element position;
Target character pattern data memory module, for determining target cache unit according to the target index value, and by the target Character pattern data is stored into the target cache unit.
9. a kind of equipment, which is characterized in that the equipment includes:
One or more processors;
Memory, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now caching method of the character pattern data as described in any in claim 1-7.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor The caching method of the character pattern data as described in any in claim 1-7 is realized when execution.
CN201910435174.3A 2019-05-23 2019-05-23 Word matrix data caching method, device, equipment and storage medium Active CN110147330B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910435174.3A CN110147330B (en) 2019-05-23 2019-05-23 Word matrix data caching method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910435174.3A CN110147330B (en) 2019-05-23 2019-05-23 Word matrix data caching method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110147330A true CN110147330A (en) 2019-08-20
CN110147330B CN110147330B (en) 2023-09-01

Family

ID=67592976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910435174.3A Active CN110147330B (en) 2019-05-23 2019-05-23 Word matrix data caching method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110147330B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110837575A (en) * 2019-10-31 2020-02-25 广州华多网络科技有限公司 Method and device for generating transmission characteristic information of video image
CN112069366A (en) * 2020-08-28 2020-12-11 喜大(上海)网络科技有限公司 Recall determining method, apparatus, device and storage medium
CN112949257A (en) * 2021-02-26 2021-06-11 深圳市英威腾电气股份有限公司 Character display method, device, equipment and computer readable storage medium
CN112988795A (en) * 2021-02-26 2021-06-18 开放智能机器(上海)有限公司 Number retrieval method, system, equipment and storage medium
CN115687669A (en) * 2022-10-12 2023-02-03 广州中望龙腾软件股份有限公司 Character caching method, terminal and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101083770A (en) * 2002-08-08 2007-12-05 松下电器产业株式会社 Method for encoding and decoding moving image
US20100191912A1 (en) * 2009-01-23 2010-07-29 Konica Minolta Systems Laboratory, Inc.. Systems and Methods for Memory Management on Print Devices
US20100228941A1 (en) * 2009-03-03 2010-09-09 Qualcomm Incorporated Configurable Cache and Method to Configure Same
CN102637422A (en) * 2012-02-17 2012-08-15 天地融科技股份有限公司 Matrix obtaining method, character display device and system and electronic signature tool
CN104657362A (en) * 2013-11-18 2015-05-27 深圳市腾讯计算机系统有限公司 Method and device for storing and querying data
CN106294291A (en) * 2016-07-20 2017-01-04 中国航空无线电电子研究所 A kind of TrueType font rendering intent
CN106484734A (en) * 2015-09-01 2017-03-08 天脉聚源(北京)科技有限公司 A kind of data query caching method and system
CN106528647A (en) * 2016-10-15 2017-03-22 北京语联炉火信息技术有限公司 Term matching method based on a cedar double-array trie algorithm
CN107071471A (en) * 2011-10-28 2017-08-18 太阳专利托管公司 Method for encoding images and picture coding device
CN107291858A (en) * 2017-06-09 2017-10-24 成都索贝数码科技股份有限公司 Data indexing method based on character string suffix
CN107402817A (en) * 2017-08-01 2017-11-28 深圳创维数字技术有限公司 Save method, apparatus, set top box and the storage medium of internal memory
CN107622115A (en) * 2017-09-19 2018-01-23 武大吉奥信息技术有限公司 A kind of space querying result cache method towards WFS services
CN109299719A (en) * 2018-09-30 2019-02-01 武汉斗鱼网络科技有限公司 Barrage method of calibration, device, terminal and storage medium based on Character segmentation

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101083770A (en) * 2002-08-08 2007-12-05 松下电器产业株式会社 Method for encoding and decoding moving image
US20100191912A1 (en) * 2009-01-23 2010-07-29 Konica Minolta Systems Laboratory, Inc.. Systems and Methods for Memory Management on Print Devices
US20100228941A1 (en) * 2009-03-03 2010-09-09 Qualcomm Incorporated Configurable Cache and Method to Configure Same
CN107071471A (en) * 2011-10-28 2017-08-18 太阳专利托管公司 Method for encoding images and picture coding device
CN102637422A (en) * 2012-02-17 2012-08-15 天地融科技股份有限公司 Matrix obtaining method, character display device and system and electronic signature tool
CN104657362A (en) * 2013-11-18 2015-05-27 深圳市腾讯计算机系统有限公司 Method and device for storing and querying data
CN106484734A (en) * 2015-09-01 2017-03-08 天脉聚源(北京)科技有限公司 A kind of data query caching method and system
CN106294291A (en) * 2016-07-20 2017-01-04 中国航空无线电电子研究所 A kind of TrueType font rendering intent
CN106528647A (en) * 2016-10-15 2017-03-22 北京语联炉火信息技术有限公司 Term matching method based on a cedar double-array trie algorithm
CN107291858A (en) * 2017-06-09 2017-10-24 成都索贝数码科技股份有限公司 Data indexing method based on character string suffix
CN107402817A (en) * 2017-08-01 2017-11-28 深圳创维数字技术有限公司 Save method, apparatus, set top box and the storage medium of internal memory
CN107622115A (en) * 2017-09-19 2018-01-23 武大吉奥信息技术有限公司 A kind of space querying result cache method towards WFS services
CN109299719A (en) * 2018-09-30 2019-02-01 武汉斗鱼网络科技有限公司 Barrage method of calibration, device, terminal and storage medium based on Character segmentation

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
范志敏 等: "基于VB实现的的汉字点阵字模的提取方法", 《全国冶金自动化信息网年会论文集》 *
范志敏 等: "基于VB实现的的汉字点阵字模的提取方法", 《全国冶金自动化信息网年会论文集》, 1 August 2004 (2004-08-01), pages 421 - 423 *
黄海宏 等: "液晶显示器汉字字模存储方法", 《现代电子技术》 *
黄海宏 等: "液晶显示器汉字字模存储方法", 《现代电子技术》, 1 August 2006 (2006-08-01), pages 162 - 164 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110837575A (en) * 2019-10-31 2020-02-25 广州华多网络科技有限公司 Method and device for generating transmission characteristic information of video image
CN112069366A (en) * 2020-08-28 2020-12-11 喜大(上海)网络科技有限公司 Recall determining method, apparatus, device and storage medium
CN112069366B (en) * 2020-08-28 2024-02-09 喜大(上海)网络科技有限公司 Recall determination method, recall determination device, recall determination equipment and storage medium
CN112949257A (en) * 2021-02-26 2021-06-11 深圳市英威腾电气股份有限公司 Character display method, device, equipment and computer readable storage medium
CN112988795A (en) * 2021-02-26 2021-06-18 开放智能机器(上海)有限公司 Number retrieval method, system, equipment and storage medium
CN115687669A (en) * 2022-10-12 2023-02-03 广州中望龙腾软件股份有限公司 Character caching method, terminal and storage medium

Also Published As

Publication number Publication date
CN110147330B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
CN110147330A (en) A kind of caching method of character pattern data, device, equipment and storage medium
CN111090628A (en) Data processing method and device, storage medium and electronic equipment
CN108959127B (en) Address translation method, device and system
CN106250226B (en) Method for scheduling task and system based on consistency hash algorithm
CN109388626B (en) Method and apparatus for assigning numbers to services
US11822912B2 (en) Software installation through an overlay file system
CN104731569A (en) Data processing method and relevant equipment
CN105808219A (en) Memory space allocation method and apparatus
CN109582649B (en) Metadata storage method, device and equipment and readable storage medium
US20200371827A1 (en) Method, Apparatus, Device and Medium for Processing Data
AU2020308941A1 (en) Dynamic allocation of computing resources
CN109165712A (en) Distributed generation method, device and computer storage medium by stages number
EP3872642A1 (en) Caching device, cache, system, method and apparatus for processing data, and medium
CN117130663B (en) Instruction reading method, L2 instruction cache, electronic equipment and storage medium
CN113344074A (en) Model training method, device, equipment and storage medium
CN102917036A (en) Memcached-based distributed cache data synchronization realization method
CN111949648B (en) Memory data caching system and data indexing method
CN106293862B (en) A kind of analysis method and device of expandable mark language XML data
CN116467235A (en) DMA-based data processing method and device, electronic equipment and medium
CN113888028A (en) Patrol task allocation method and device, electronic equipment and storage medium
CN111324438B (en) Request scheduling method and device, storage medium and electronic equipment
CN113485644A (en) IO data storage method and server
CN114647686A (en) Data processing method, device, equipment, medium and product
CN111782834A (en) Image retrieval method, device, equipment and computer readable storage medium
CN110750316A (en) Method for processing internal task or input event and application program architecture system

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
GR01 Patent grant
GR01 Patent grant