CN107368872A - A kind of method and apparatus for generating bar code image - Google Patents

A kind of method and apparatus for generating bar code image Download PDF

Info

Publication number
CN107368872A
CN107368872A CN201610321596.4A CN201610321596A CN107368872A CN 107368872 A CN107368872 A CN 107368872A CN 201610321596 A CN201610321596 A CN 201610321596A CN 107368872 A CN107368872 A CN 107368872A
Authority
CN
China
Prior art keywords
bar code
wearable device
code
original
image
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
CN201610321596.4A
Other languages
Chinese (zh)
Other versions
CN107368872B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610321596.4A priority Critical patent/CN107368872B/en
Priority to PCT/CN2017/084292 priority patent/WO2017194024A1/en
Publication of CN107368872A publication Critical patent/CN107368872A/en
Application granted granted Critical
Publication of CN107368872B publication Critical patent/CN107368872B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06046Constructional details

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a kind of method and apparatus for generating bar code image, belong to field of computer technology.Methods described includes:The wearable device receives bar code generation instruction, obtains original bar code corresponding to the bar code generation instruction in plain text;The wearable device carries out code conversion to the original bar code, obtains bar code value in plain text according to the coding rule being stored in advance in firmware code;The bar code value is depicted as bar code image, and show the bar code image by the wearable device by the firmware code.Using the present invention, the similar less equipment of this memory space of wearable device can integrate the firmware code to realize the processing of generation bar code image under embedded platform in system program.

Description

A kind of method and apparatus for generating bar code image
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and apparatus for generating bar code image.
Background technology
Bar code is by multiple secret notes and informal voucher, is arranged according to certain coding rule, to express the figure of a group information Shape identifier.Bar code can be used for identifying the much informations such as the trade name of commodity, book classification number, mail numbering, thus It is widely used in many fields such as commodity circulation, taking care of books, postal management, banking system.
The processing of current generation bar code is usually to use to be based on android (Android)/windows (window-operating systems System) system platform, call android/windows systems in existing function handling graph, using bar code in plain text as function Input value, so as to obtain drawn bar code after being handled using the function handling graph, wherein, bar code can be in plain text For generating bar code image, not encrypted character string.
During the present invention is realized, inventor has found that prior art at least has problems with:
Function handling graph in android/windows systems is existing packaged function set, possesses and includes The function of a variety of graphic plottings including drafting bar code, therefore the data volume of the function handling graph is larger, the storage of occupancy Space is more, so, is unfavorable for using in the less equipment of wearable device (such as bracelet) this memory space.
The content of the invention
In order to solve problem of the prior art, the embodiment of the present invention provides a kind of method and dress for generating bar code image Put.The technical scheme is as follows:
First aspect, there is provided a kind of method for generating bar code image, methods described include:
The wearable device receives bar code generation instruction, obtains original bar code corresponding to the bar code generation instruction in plain text;
The wearable device is carried out in plain text according to the coding rule being stored in advance in firmware code to the original bar code Code conversion, obtain bar code value;
The wearable device is depicted as bar code image by the firmware code, by the bar code value, and described in showing Bar code image.
Optionally, methods described also includes:
Determine the first barcode types corresponding to the original bar code plaintext;
The wearable device is carried out in plain text according to the coding rule being stored in advance in firmware code to the original bar code Code conversion, bar code value is obtained, including:
The wearable device is according to the barcode types being stored in advance in firmware code and the corresponding relation of coding rule, really Coding rule corresponding to fixed first barcode types;
According to coding rule corresponding to first barcode types, code conversion is carried out in plain text to the original bar code, obtained To bar code value.
Optionally, it is described that the bar code value is depicted as bar code image, including:
It is determined that starting point coordinate and end point coordinates per rule code line;
According to the screen size of the wearable device, and the digit of the bar code value, every rule code line is determined Spacing;
According to starting point coordinate, end point coordinates and the spacing per rule code line, by each bar in the bar code value Code character is depicted as corresponding bar code line, generates bar code image.
Optionally, methods described also includes:
When receiving bar code image store instruction, deposit the original bar code is corresponding with the bar code image in plain text Storage is in the wearable device.
Optionally, methods described also includes:
When the bar code that the wearable device receives the corresponding original bar code plaintext again generates instruction, if described Wearable device be stored with the original bar code plaintext corresponding to bar code image, then show the bar code image.
Second aspect, there is provided a kind of device for generating bar code image, described device include:
Acquisition module, for receiving bar code generation instruction, obtain original bar code corresponding to the bar code generation instruction in plain text;
Modular converter, for according to the coding rule being stored in advance in firmware code, entering in plain text to the original bar code Row code conversion, obtains bar code value;
Drafting module, for by the firmware code, the bar code value to be depicted as into bar code image, and described in showing Bar code image.
Optionally, described device also includes:
Determining module, for determining the first barcode types corresponding to the original bar code plaintext;
The modular converter, is used for:
According to the barcode types and the corresponding relation of coding rule being stored in advance in firmware code, described first is determined Coding rule corresponding to code type;
According to coding rule corresponding to first barcode types, code conversion is carried out in plain text to the original bar code, obtained To bar code value.
Optionally, the drafting module, is used for:
It is determined that starting point coordinate and end point coordinates per rule code line;
According to the screen size of the wearable device, and the digit of the bar code value, every rule code line is determined Spacing;
According to starting point coordinate, end point coordinates and the spacing per rule code line, by each bar in the bar code value Code character is depicted as corresponding bar code line, generates bar code image.
Optionally, described device also includes:
Memory module, for when receiving bar code image store instruction, by the original bar code in plain text and the bar Barcode image is correspondingly stored in the wearable device.
Optionally, described device also includes:
Display module, the bar code generation for receiving the corresponding original bar code plaintext again when the wearable device refer to When making, if the wearable device be stored with the original bar code plaintext corresponding to bar code image, show the bar code Image.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
In the embodiment of the present invention, the firmware code for being exclusively used in generating bar code is integrated with the system program of wearable device, Wearable device receives bar code generation instruction, and obtaining original bar code corresponding to bar code generation instruction, in plain text, wearable device is according in advance The coding rule being stored in firmware code, code conversion is carried out in plain text to original bar code, obtains bar code value, wearable device passes through Firmware code, bar code value is depicted as bar code image, and shows bar code image.So, it is exclusively used in generating consolidating for bar code Part code only needs to include the code for completing above-mentioned processing, so the data volume of firmware code is smaller, so as to reduce wearing The memory space of formula equipment takes.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, make required in being described below to embodiment Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1 is a kind of method flow diagram for generating bar code image provided in an embodiment of the present invention;
Fig. 2 is a kind of step schematic diagram for drawing bar code image provided in an embodiment of the present invention;
Fig. 3 is a kind of apparatus structure schematic diagram for generating bar code image provided in an embodiment of the present invention;
Fig. 4 is a kind of structural representation of wearable device provided in an embodiment of the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention Formula is described in further detail.
The embodiments of the invention provide a kind of method for generating bar code, the executive agent of this method is wearable device.Its In, wearable device can be the wearable device with generation bar code function, such as Intelligent bracelet, smart pen, bluetooth earphone Deng, can be integrated with its system program be exclusively used in generate bar code firmware code.Wearable device can include closely leading to Believe part, for carrying out information exchange with miscellaneous equipment, short-range communication part can be NFC (Near Field Communication, near field communication (NFC)) communication component or bluetooth communication means, wearable device can include screen, For the information for needing to show during display generation bar code, such as original bar code plaintext, bar code image etc..Wearable device can So that including input block, such as button, touch-screen, user generation bar code can be carried out on wearable device by input block During the input operation that may relate to;Wearable device can include processor, and processor can be used for responsible wearable device and exist The processing that the process of control smart machine is carried out;Wearable device can also include memory, and memory can be used for record and wear Wear equipment caused data and data sent at miscellaneous equipment of reception during bar code is generated.Wearable device The parts such as sensor, output unit and power supply can also be included.In the present embodiment, so that wearable device is Intelligent bracelet as an example, The detailed description of carry out scheme, other situations are similar therewith, and the present embodiment is not repeated.
Below in conjunction with embodiment, the handling process shown in Fig. 1 is described in detail, content can be as Under:
Step 101, wearable device receives bar code generation instruction, obtains original bar code corresponding to bar code generation instruction in plain text.
In force, the firmware code for being exclusively used in generating bar code can be integrated with the system program of wearable device, i.e., It can be understood as wearable device and use embedded platform, the processing of correlation is carried out by embedded system.Herein, embedded system System is a kind of " being completely embedded into inside controlled device, the dedicated computer system designed for application-specific ", with personal computer Such general-purpose computing system is different, and what embedded system generally performed is the pre-defined task with particular requirement, Such as generate the task of bar code.Because embedded system can carry out excellent just for a special task, designer to it Change, reduce size reduction cost.Generally, embedded system can be understood as the embeded processor being stored in a ROM control The control program of making sheet.The core of embedded system is by one or more pre-programmed with for performing several tasks Microprocessor or singlechip group into.It is different that the software of user's selection can be run from all-purpose computer, in embedded system Software be typically temporarily it is constant;So " firmware " can be referred to as.
When user needs generating on wearable device and showing bar code, the bar code generation on wearable device can be clicked on Button, bar code generation button can be that physical button can also be virtual key.Bar is received so as to trigger wearable device Code generation instruction, while obtain original bar code corresponding to bar code generation instruction in plain text.Based on different situations, as follows with original bar Code is in plain text in plain text, exemplified by scheme scene is mobile-phone payment, to give and several obtain original bar codes in plain text corresponding to payment account Mode:
Mode one, the bar code generation request that wearable device receiving terminal is sent, original bar is carried in bar code generation request Code is in plain text.
In force, user can select to be paid the bill using payment account after a commodity are bought, and at this moment, use Family can open the payment class software in terminal, click on generation button in plain text, and at this moment terminal can generate and the payment In plain text, afterwards, terminal can pass through the short-range communication software such as NFC, bluetooth to original bar code corresponding to the user account of class software Establish and connect with wearable device, so as to which original bar code is sent into wearable device in plain text, wearable device can then obtain terminal Take original bar code in plain text.
Mode two, wearable device automatically generate original bar code in plain text according to the plaintext generating algorithm prestored.
In force, the payment class software for payment can be installed, user is buying a commodity in wearable device Afterwards, the payment class software on wearable device can be opened, clicks on generation button in plain text, wearable device then can be according to pre- The plaintext generating algorithm generation original bar code corresponding with the user account of the payment class software first stored is in plain text.Or wearing Above-mentioned payment class software need not be installed in equipment, it is only necessary to the plaintext generating algorithm of the embedded payment class software, and then in user Click in plain text generation button after, wearable device can the original bar code according to corresponding to plaintext generating algorithm gets user account it is bright Text.
Herein, in view of security consideration, it is above-mentioned be used to paying class original bar code can be in plain text it is periodically variable, i.e., Every original bar code possesses certain term of validity in plain text, it is necessary to regenerate new original bar code in plain text after the term of validity.
Step 102, wearable device is carried out in plain text according to the coding rule being stored in advance in firmware code to original bar code Code conversion, obtain bar code value.
In force, the coding rule for bar code conversion can be previously stored with the firmware code of wearable device, Wearable device can carry out code conversion in plain text according to coding rule to obtained original bar code, so as to obtain being used for drawing The bar code value of bar code image.
Optionally, because the species of original bar code plaintext is varied, the original got can be determined before step 102 The barcode types of beginning bar code plaintext, corresponding processing can be as follows:Wearable device determines corresponding to original bar code plaintext first Code type.
In force, wearable device can be after original bar code plaintext be got, according to the plaintext lattice of original bar code plaintext Formula (as character length, character species, mark character) etc. information determine original bar code plaintext corresponding to the first barcode types.Or Person, can record the type information of the original bar code plaintext simultaneously when original bar code plaintext is generated, and wearable device can be with The first barcode types directly according to corresponding to the type information determines original bar code plaintext.
Optionally, the situation based on the above-mentioned barcode types that original bar code plaintext is determined, the processing of step 102 can be as Under:Wearable device determines first according to the barcode types being stored in advance in firmware code and the corresponding relation of coding rule Coding rule corresponding to code type;According to coding rule corresponding to the first barcode types, carry out coding in plain text to original bar code and turn Change, obtain bar code value.
In force, a variety of barcode types and coding rule can be stored with wearable device in firmware code in advance Corresponding relation, have recorded under each barcode types that bar code value corresponding to isolog character, table 1 be not exemplary in the corresponding relation Give Code128 and the mapping table of bar code value.Wearable device is determining the first bar code corresponding to source code plaintext After type, coding rule corresponding to the first barcode types can be determined in above-mentioned corresponding relation.Afterwards, can continue according to Coding rule corresponding to one barcode types, code conversion is carried out in plain text to original bar code, so as to obtain corresponding bar code value.Specifically , this is sentenced exemplified by Code128C is encoded to illustrate.Wechat/QQ wallets/Alipay is encoded using Code128C at present, Code128C codings include start field, data field, check field and trailer field, wherein, Code128C start field Be unified in table 1 corresponding to ID105 " Start C ", data field are then indicated for the original bar code of user account in plain text, Code128C original bar code is usually the digital string encoding that length is even number in plain text, and each two numeral is a data, verification Field can be calculated by start field and data field, and corresponding calculation formula is:Check field=(ID corresponding to start field Serial number × data field bits per inch of value+data field bits per inch evidence is according to value) %103, wherein, " %103 " is to enter to 103 Row remainder calculates, and trailer field is to be unified in table 1 " Stop " corresponding to ID106.Specifically, this sentences original bar code is in plain text Exemplified by 95270078, ID corresponding to start field is that the 105, the 1st data are that the 95, the 2nd data are that the 27, the 3rd data are 0, 4th data are 78, so check field=(105+1*95+2*27+3*0+4*78) %103=51, the table of comparisons 1 are right 95270078 carry out code conversion:Start field Start C (bbsbssbbbss)+data bit [95 (bsbbbbsbsss)+27 (bbbsbbssbss) (the bbsbbbsbsss)+stop bits of+00 (bbsbbssbbss)+78 (bbssssbsbss)+check bit 51 Stop (bbsssbbbsbsbb), so as to obtain bar code value (bbsbssbbbssbsbbbbsbsssbbbsbbssbssbbsbb ssbbssbbssssbsbssbbsbbbsbsssbbsssbbbsbsbb)。
Table 1
Step 103, bar code value is depicted as bar code image, and show bar code figure by wearable device by firmware code Picture.
In force, wearable device, can be by firmware code after bar code value corresponding to original bar code plaintext is obtained, will Bar code value is depicted as bar code image, further, because bar code value only includes two kinds of characters, can select two kinds of differences respectively The lines of color correspond to two kinds of characters, you can so that the lines of two kinds of colors closely to be arranged by character sequence, you can generation phase The bar code image answered, and then, wearable device can include bar code image on screen.For example, for above Bar code value (bbsbssbbbssbsbbbbsbsssbbbsbbssbssbbsbbssbbssbbssssbsbssb corresponding to 95270078 Bsbbbsbsssbbsssbbbsbsbb), in this step, b need to only be marked with black line, s is marked with white wire, it is possible to Bar code image corresponding to generation.
Optionally, the process for bar code image being drawn in step 103 can be with specific as follows:It is determined that the starting per rule code line Point coordinates and end point coordinates;According to the digit of the screen size of wearable device, and bar code value, it is determined that per between rule code line Away from;According to the starting point coordinate of every rule code line, terminate point coordinates and spacing, each bar code character in bar code value is depicted as pair The bar code line answered, generate bar code image.
In force, the producers of wearable device can be implanted into following code in the firmware code of wearable device, from And wearable device can complete the corresponding processing for drawing bar code image.Specifically, in view of draw bar code when be according to Bar code line is drawn one by one, then can first determine the starting point coordinate of every rule code line and terminate point coordinates, herein it is contemplated that using X-Y plane coordinate represents, then can determine that the X-coordinate and Y-coordinate of the starting point of every rule code line, and the Y of end point are sat Mark.Afterwards, every bar code can be determined according to the digit of the screen size of wearable device, and bar code value with producers The spacing of line, the width of every rule code line can be considered per the spacing of rule code line.Finally, wearable device then can basis The starting point coordinate of every rule code line of above-mentioned determination, terminate point coordinates and spacing, by each bar code character in bar code value successively Bar code line corresponding to being depicted as, it is thus possible to generate bar code image.Fig. 2 gives a kind of simple drawing process schematic diagram.
The code of above-mentioned drafting bar code image can be as follows:
Optionally, for some conventional bar codes that will not be changed, what wearable device can be selective deposit Storage, corresponding processing can be as follows:When receiving bar code image store instruction, by original bar code plaintext and bar code image It is corresponding to be stored in wearable device.
In force, after wearable device is depicted as bar code image in plain text according to original bar code, if the user thinks that should Bar code image is conventional bar code image, then can click on the storage button on wearable device, and at this moment, wearable device then can be with Receive bar code image store instruction, so as to, wearable device can will the bar code image currently shown and its corresponding to it is former Beginning bar code carries out corresponding storage in plain text.
Optionally, based on the original bar code of above-mentioned storage, the situation with bar code image, wearable device are getting original in plain text After beginning bar code plaintext, judge locally whether be stored with corresponding bar code image, corresponding processing can be as follows:When wearing is set It is standby receive corresponding original bar code plaintext again bar code generation instruction when, if to be stored with original bar code right in plain text for wearable device The bar code image answered, then show bar code image.
In force, original bar code is stored in plain text and after bar code image in wearable device, receive correspond to some again During the bar code generation instruction of original bar code plaintext, the original bar code can be obtained in plain text, and local whether be stored with may determine that Bar code image corresponding to the original bar code plaintext.If wearable device is stored with bar code figure corresponding to original bar code plaintext Picture, then the bar code image of storage can be directly displayed, if if wearable device is not stored with corresponding to original bar code plaintext Bar code image, then it can carry out the processing of step 102 and step 103 in plain text based on the original bar code.
In the embodiment of the present invention, the firmware code for being exclusively used in generating bar code is integrated with the system program of wearable device, Wearable device receives bar code generation instruction, and obtaining original bar code corresponding to bar code generation instruction, in plain text, wearable device is according in advance The coding rule being stored in firmware code, code conversion is carried out in plain text to original bar code, obtains bar code value, wearable device passes through Firmware code, bar code value is depicted as bar code image, and shows bar code image.So, it is exclusively used in generating consolidating for bar code The data volume of part code is smaller, and the memory space of occupancy is less, so as to which such as the less equipment of this memory space of wearable device can The processing of generation bar code image under embedded platform is realized to integrate the firmware code in system program.
Based on identical technical concept, the embodiment of the present invention additionally provides a kind of device for generating bar code image, such as Fig. 3 Shown, the device includes:
Acquisition module 301, for receiving bar code generation instruction, it is bright to obtain original bar code corresponding to the bar code generation instruction Text;
Modular converter 302, the coding rule being stored in advance in for basis in firmware code, to the original bar code in plain text Code conversion is carried out, obtains bar code value;
Drafting module 303, for by the firmware code, the bar code value being depicted as into bar code image, and show The bar code image.
Optionally, described device also includes:
Determining module, for determining the first barcode types corresponding to the original bar code plaintext;
The modular converter, is used for:
According to the barcode types and the corresponding relation of coding rule being stored in advance in firmware code, described first is determined Coding rule corresponding to code type;
According to coding rule corresponding to first barcode types, code conversion is carried out in plain text to the original bar code, obtained To bar code value.
Optionally, the drafting module, is used for:
It is determined that starting point coordinate and end point coordinates per rule code line;
According to the screen size of the wearable device, and the digit of the bar code value, every rule code line is determined Spacing;
According to starting point coordinate, end point coordinates and the spacing per rule code line, by each bar in the bar code value Code character is depicted as corresponding bar code line, generates bar code image.
Optionally, described device also includes:
Memory module, for when receiving bar code image store instruction, by the original bar code in plain text and the bar Barcode image is correspondingly stored in the wearable device.
Optionally, described device also includes:
Display module, the bar code generation for receiving the corresponding original bar code plaintext again when the wearable device refer to When making, if the wearable device be stored with the original bar code plaintext corresponding to bar code image, show the bar code Image.
In the embodiment of the present invention, the firmware code for being exclusively used in generating bar code is integrated with the system program of wearable device, Wearable device receives bar code generation instruction, and obtaining original bar code corresponding to bar code generation instruction, in plain text, wearable device is according in advance The coding rule being stored in firmware code, code conversion is carried out in plain text to original bar code, obtains bar code value, wearable device passes through Firmware code, bar code value is depicted as bar code image, and shows bar code image.So, it is exclusively used in generating consolidating for bar code Part code only needs to include the code for completing above-mentioned processing, so the data volume of firmware code is smaller, so as to reduce wearing The memory space of formula equipment takes.
It should be noted that:Above-described embodiment provide generation bar code image device when generating bar code image, , can be as needed and by above-mentioned function distribution only with the division progress of above-mentioned each functional module for example, in practical application Completed by different functional modules, i.e., the internal structure of device is divided into different functional modules, it is described above to complete All or part of function.In addition, the device for the generation bar code image that above-described embodiment provides and generation bar code image Embodiment of the method belongs to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
Fig. 4 is a kind of structural representation of wearable device according to an exemplary embodiment.The wearable device can be with For the method for the addition good friend's account for implementing to provide in above-described embodiment.
Wearable device 400 can include RF (Radio Frequency, radio frequency) circuit 110, include one or one with Memory 120, input block 130, display unit 140, sensor 150, the voicefrequency circuit of upper computer-readable recording medium 160th, WiFi (wireless fidelity, Wireless Fidelity) module 170, include one or more than one processing core The part such as processor 180 and power supply 190.It will be understood by those skilled in the art that the wearable device structure shown in Fig. 4 is simultaneously The restriction to wearable device is not formed, can be included than illustrating more or less parts, either combines some parts or not Same part arrangement.Wherein:
RF circuits 110 can be used for receive and send messages or communication process in, the reception and transmission of signal, especially, by base station After downlink information receives, transfer to one or more than one processor 180 is handled;In addition, it is sent to up data are related to Base station.Generally, RF circuits 110 include but is not limited to antenna, at least one amplifier, tuner, one or more oscillators, use Family identity module (SIM) card, transceiver, coupler, LNA (Low Noise Amplifier, low-noise amplifier), duplex Device etc..In addition, RF circuits 110 can also be communicated by radio communication with network and other equipment.The radio communication can make With any communication standard or agreement, and including but not limited to GSM (Global System of Mobile communication, entirely Ball mobile communcations system), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, WCDMA), LTE (Long Term Evolution, Long Term Evolution), Email, SMS (Short Messaging Service, Short Message Service) etc..
Memory 120 can be used for storage software program and module, and processor 180 is stored in memory 120 by operation Software program and module, so as to perform various function application and data processing.Memory 120 can mainly include storage journey Sequence area and storage data field, wherein, storing program area can storage program area, the application program (ratio needed at least one function Such as sound-playing function, image player function) etc.;Storage data field can store to be created according to using for wearable device 400 Data (such as voice data, phone directory etc.) etc..In addition, memory 120 can include high-speed random access memory, may be used also With including nonvolatile memory, for example, at least a disk memory, flush memory device or other volatile solid-states Part.Correspondingly, memory 120 can also include Memory Controller, to provide processor 180 and input block 130 to storage The access of device 120.
Input block 130 can be used for the numeral or character information for receiving input, and generation is set with user and function Control relevant keyboard, mouse, action bars, optics or the input of trace ball signal.Specifically, input block 130 may include to touch Sensitive surfaces 131 and other input equipments 132.Touch sensitive surface 131, also referred to as touch display screen or Trackpad, collect and use Family on or near it touch operation (such as user using any suitable object or annex such as finger, stylus in touch-sensitive table Operation on face 131 or near touch sensitive surface 131), and corresponding attachment means are driven according to formula set in advance.It is optional , touch sensitive surface 131 may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus detection is used The touch orientation at family, and the signal that touch operation is brought is detected, transmit a signal to touch controller;Touch controller is from touch Touch information is received in detection means, and is converted into contact coordinate, then gives processor 180, and can reception processing device 180 The order sent simultaneously is performed.Furthermore, it is possible to using polytypes such as resistance-type, condenser type, infrared ray and surface acoustic waves Realize touch sensitive surface 131.Except touch sensitive surface 131, input block 130 can also include other input equipments 132.Specifically, Other input equipments 132 can include but is not limited to physical keyboard, function key (such as volume control button, switch key etc.), One or more in trace ball, mouse, action bars etc..
Display unit 140 can be used for display by the information of user's input or be supplied to the information and wearable device of user 400 various graphical user interface, these graphical user interface can by figure, text, icon, video and its any combination Lai Form.Display unit 140 may include display panel 141, optionally, can use LCD (Liquid Crystal Display, Liquid crystal display), the form such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) configure display Panel 141.Further, touch sensitive surface 131 can cover display panel 141, when touch sensitive surface 131 is detected on or near it Touch operation after, send processor 180 to determine the type of touch event, be followed by subsequent processing device 180 according to touch event Type provides corresponding visual output on display panel 141.Although in Fig. 4, touch sensitive surface 131 is with display panel 141 The part independent as two come realize input and input function, but in some embodiments it is possible to by touch sensitive surface 131 with Display panel 141 is integrated and realizes input and output function.
Wearable device 400 may also include at least one sensor 150, for example, optical sensor, motion sensor and other Sensor.Specifically, optical sensor may include ambient light sensor and proximity transducer, wherein, ambient light sensor can basis The light and shade of ambient light adjusts the brightness of display panel 141, proximity transducer can when wearable device 400 is moved in one's ear, Close display panel 141 and/or backlight.As one kind of motion sensor, gravity accelerometer can detect all directions The size of upper (generally three axles) acceleration, can detect that size and the direction of gravity, available for identification mobile phone posture when static Application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (for example pedometer, strikes Hit) etc.;The gyroscope that can also configure as wearable device 400, barometer, hygrometer, thermometer, infrared ray sensor etc. other Sensor, it will not be repeated here.
Voicefrequency circuit 160, loudspeaker 161, microphone 162 can provide the COBBAIF between user and wearable device 400. Electric signal after the voice data received conversion can be transferred to loudspeaker 161, is changed by loudspeaker 161 by voicefrequency circuit 160 Exported for voice signal;On the other hand, the voice signal of collection is converted to electric signal by microphone 162, is connect by voicefrequency circuit 160 Voice data is converted to after receipts, then after voice data output processor 180 is handled, it is such as another to be sent to through RF circuits 110 One wearable device, or voice data is exported to memory 120 further to handle.Voicefrequency circuit 160 is also possible that Earphone jack, to provide the communication of peripheral hardware earphone and wearable device 400.
WiFi belongs to short range wireless transmission technology, and wearable device 400 can help user to receive and dispatch by WiFi module 170 Email, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and accessed.Although Fig. 4 WiFi module 170 is shown, but it is understood that, it is simultaneously not belonging to must be configured into for wearable device 400, completely can root Omitted according to needs in the essential scope for do not change invention.
Processor 180 is the control centre of wearable device 400, utilizes each of various interfaces and connection whole mobile phone Part, by running or performing the software program and/or module that are stored in memory 120, and call and be stored in memory Data in 120, the various functions and processing data of wearable device 400 are performed, so as to carry out integral monitoring to mobile phone.It is optional , processor 180 may include one or more processing cores;Preferably, processor 180 can integrate application processor and modulatedemodulate Processor is adjusted, wherein, application processor mainly handles operating system, user interface and application program etc., modem processor Main processing radio communication.It is understood that above-mentioned modem processor can not also be integrated into processor 180.
Wearable device 400 also includes the power supply 190 (such as battery) to all parts power supply, it is preferred that power supply can lead to Cross power-supply management system and processor 180 be logically contiguous, so as to by power-supply management system realize management charging, electric discharge and The functions such as power managed.Power supply 190 can also include one or more direct current or AC power, recharging system, electricity The random component such as source failure detector circuit, power supply changeover device or inverter, power supply status indicator.
Although being not shown, wearable device 400 can also include camera, bluetooth module etc., will not be repeated here.Specifically exist In the present embodiment, the display unit of wearable device 400 is touch-screen display, and wearable device 400 also includes memory, and One or more than one program, one of them or more than one program storage are configured to by one in memory Individual either more than one computing device states one or more than one program bag contains the instruction for being used for being operated below:
The wearable device receives bar code generation instruction, obtains original bar code corresponding to the bar code generation instruction in plain text;
The wearable device is carried out in plain text according to the coding rule being stored in advance in firmware code to the original bar code Code conversion, obtain bar code value;
The wearable device is depicted as bar code image by the firmware code, by the bar code value, and described in showing Bar code image.
Optionally, methods described also includes:
Determine the first barcode types corresponding to the original bar code plaintext;
The wearable device is carried out in plain text according to the coding rule being stored in advance in firmware code to the original bar code Code conversion, bar code value is obtained, including:
The wearable device is according to the barcode types being stored in advance in firmware code and the corresponding relation of coding rule, really Coding rule corresponding to fixed first barcode types;
According to coding rule corresponding to first barcode types, code conversion is carried out in plain text to the original bar code, obtained To bar code value.
Optionally, it is described that the bar code value is depicted as bar code image, including:
It is determined that starting point coordinate and end point coordinates per rule code line;
According to the screen size of the wearable device, and the digit of the bar code value, every rule code line is determined Spacing;
According to starting point coordinate, end point coordinates and the spacing per rule code line, by each bar in the bar code value Code character is depicted as corresponding bar code line, generates bar code image.
Optionally, methods described also includes:
When receiving bar code image store instruction, deposit the original bar code is corresponding with the bar code image in plain text Storage is in the wearable device.
Optionally, methods described also includes:
When the bar code that the wearable device receives the corresponding original bar code plaintext again generates instruction, if described Wearable device be stored with the original bar code plaintext corresponding to bar code image, then show the bar code image.
In the embodiment of the present invention, the firmware code for being exclusively used in generating bar code is integrated with the system program of wearable device, Wearable device receives bar code generation instruction, and obtaining original bar code corresponding to bar code generation instruction, in plain text, wearable device is according in advance The coding rule being stored in firmware code, code conversion is carried out in plain text to original bar code, obtains bar code value, wearable device passes through Firmware code, bar code value is depicted as bar code image, and shows bar code image.So, it is exclusively used in generating consolidating for bar code Part code only needs to include the code for completing above-mentioned processing, so the data volume of firmware code is smaller, so as to reduce wearing The memory space of formula equipment takes.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment To complete, by program the hardware of correlation can also be instructed to complete, described program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent substitution and improvements made etc., it should be included in the scope of the protection.

Claims (10)

  1. A kind of 1. method for generating bar code image, it is characterised in that be integrated with the system program of wearable device and be exclusively used in giving birth to The firmware code of code is in strip, methods described includes:
    The wearable device receives bar code generation instruction, obtains original bar code corresponding to the bar code generation instruction in plain text;
    The wearable device encodes in plain text according to the coding rule being stored in advance in firmware code to the original bar code Conversion, obtains bar code value;
    The bar code value is depicted as bar code image, and show the bar shaped by the wearable device by the firmware code Code image.
  2. 2. according to the method for claim 1, it is characterised in that methods described also includes:
    Determine the first barcode types corresponding to the original bar code plaintext;
    The wearable device encodes in plain text according to the coding rule being stored in advance in firmware code to the original bar code Conversion, obtains bar code value, including:
    The wearable device determines institute according to the barcode types being stored in advance in firmware code and the corresponding relation of coding rule State coding rule corresponding to the first barcode types;
    According to coding rule corresponding to first barcode types, code conversion is carried out in plain text to the original bar code, obtains bar Code value.
  3. 3. according to the method for claim 1, it is characterised in that described that the bar code value is depicted as bar code image, bag Include:
    It is determined that starting point coordinate and end point coordinates per rule code line;
    According to the screen size of the wearable device, and the digit of the bar code value, the spacing per rule code line is determined;
    According to starting point coordinate, end point coordinates and the spacing per rule code line, by each bar code word in the bar code value Symbol is depicted as corresponding bar code line, generates bar code image.
  4. 4. according to the method for claim 1, it is characterised in that methods described also includes:
    When receiving bar code image store instruction, it is stored in the original bar code is corresponding with the bar code image in plain text In the wearable device.
  5. 5. according to the method for claim 4, it is characterised in that methods described also includes:
    When the bar code that the wearable device receives the corresponding original bar code plaintext again generates instruction, if the wearing Equipment be stored with the original bar code plaintext corresponding to bar code image, then show the bar code image.
  6. 6. a kind of device for generating bar code image, it is characterised in that be integrated with the system program of wearable device and be exclusively used in giving birth to The firmware code of code is in strip, described device includes:
    Acquisition module, for receiving bar code generation instruction, obtain original bar code corresponding to the bar code generation instruction in plain text;
    Modular converter, for according to the coding rule being stored in advance in firmware code, being compiled in plain text to the original bar code Code conversion, obtains bar code value;
    Drafting module, for by the firmware code, the bar code value being depicted as into bar code image, and show the bar shaped Code image.
  7. 7. device according to claim 6, it is characterised in that described device also includes:
    Determining module, for determining the first barcode types corresponding to the original bar code plaintext;
    The modular converter, is used for:
    According to the barcode types and the corresponding relation of coding rule being stored in advance in firmware code, the first bar code class is determined Coding rule corresponding to type;
    According to coding rule corresponding to first barcode types, code conversion is carried out in plain text to the original bar code, obtains bar Code value.
  8. 8. device according to claim 6, it is characterised in that the drafting module, be used for:
    It is determined that starting point coordinate and end point coordinates per rule code line;
    According to the screen size of the wearable device, and the digit of the bar code value, the spacing per rule code line is determined;
    According to starting point coordinate, end point coordinates and the spacing per rule code line, by each bar code word in the bar code value Symbol is depicted as corresponding bar code line, generates bar code image.
  9. 9. device according to claim 6, it is characterised in that described device also includes:
    Memory module, for when receiving bar code image store instruction, by the original bar code in plain text and the bar code Image is correspondingly stored in the wearable device.
  10. 10. device according to claim 9, it is characterised in that described device also includes:
    Display module, the bar code for receiving the corresponding original bar code plaintext again when the wearable device generate instruction When, if the wearable device be stored with the original bar code plaintext corresponding to bar code image, show the bar code figure Picture.
CN201610321596.4A 2016-05-13 2016-05-13 A kind of method and apparatus generating bar code image Active CN107368872B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610321596.4A CN107368872B (en) 2016-05-13 2016-05-13 A kind of method and apparatus generating bar code image
PCT/CN2017/084292 WO2017194024A1 (en) 2016-05-13 2017-05-15 Method and apparatus for generating barcode pattern

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610321596.4A CN107368872B (en) 2016-05-13 2016-05-13 A kind of method and apparatus generating bar code image

Publications (2)

Publication Number Publication Date
CN107368872A true CN107368872A (en) 2017-11-21
CN107368872B CN107368872B (en) 2019-04-23

Family

ID=60266683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610321596.4A Active CN107368872B (en) 2016-05-13 2016-05-13 A kind of method and apparatus generating bar code image

Country Status (2)

Country Link
CN (1) CN107368872B (en)
WO (1) WO2017194024A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002821A (en) * 2018-07-19 2018-12-14 武汉科技大学 A kind of Internetbank shield digit recognition method based on connected domain and tangent slope
CN110263895A (en) * 2019-06-25 2019-09-20 北京慧眼智行科技有限公司 A kind of yard of drawing generating method and system
CN111310876A (en) * 2020-03-18 2020-06-19 中科星图(深圳)数字技术产业研发中心有限公司 Personnel management method and management system for epidemic situation prevention and control
CN111340166A (en) * 2020-03-18 2020-06-26 中科星图(深圳)数字技术产业研发中心有限公司 Method for generating unique identification map
CN112800799A (en) * 2021-01-27 2021-05-14 迅镭智能(广州)科技有限公司 Character conversion system for scanning gun
CN114372547A (en) * 2021-12-22 2022-04-19 广西柳钢东信科技有限公司 Two-dimensional bar code design method for steel serial number identification

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9721237B2 (en) * 2011-06-24 2017-08-01 Paypal, Inc. Animated two-dimensional barcode checks
CN113672230B (en) * 2021-06-23 2024-04-09 重庆斯欧智能科技研究院有限公司 Industrial element identification coding method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102934008A (en) * 2010-04-20 2013-02-13 索尼电脑娱乐公司 Universal active 3d stereo shutter glasses
CN104866093A (en) * 2015-04-27 2015-08-26 百度在线网络技术(北京)有限公司 Method and apparatus for obtaining interactive code in wearable device and wearable device
CN105205776A (en) * 2015-09-28 2015-12-30 梁天润 Interaction method for Internet of things on basis of intelligent wearable device
CN105394890A (en) * 2015-12-29 2016-03-16 聂洪贵 Intelligent wearing accessory with NFC payment function and use method thereof
CN108491748A (en) * 2018-04-02 2018-09-04 腾讯音乐娱乐科技(深圳)有限公司 The identification and generation method of graphic code, device and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102934008A (en) * 2010-04-20 2013-02-13 索尼电脑娱乐公司 Universal active 3d stereo shutter glasses
CN104866093A (en) * 2015-04-27 2015-08-26 百度在线网络技术(北京)有限公司 Method and apparatus for obtaining interactive code in wearable device and wearable device
CN105205776A (en) * 2015-09-28 2015-12-30 梁天润 Interaction method for Internet of things on basis of intelligent wearable device
CN105394890A (en) * 2015-12-29 2016-03-16 聂洪贵 Intelligent wearing accessory with NFC payment function and use method thereof
CN108491748A (en) * 2018-04-02 2018-09-04 腾讯音乐娱乐科技(深圳)有限公司 The identification and generation method of graphic code, device and computer readable storage medium

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002821A (en) * 2018-07-19 2018-12-14 武汉科技大学 A kind of Internetbank shield digit recognition method based on connected domain and tangent slope
CN109002821B (en) * 2018-07-19 2021-11-02 武汉科技大学 Online silver shield digital identification method based on connected domain and tangent slope
CN110263895A (en) * 2019-06-25 2019-09-20 北京慧眼智行科技有限公司 A kind of yard of drawing generating method and system
CN110263895B (en) * 2019-06-25 2023-02-17 北京慧眼智行科技有限公司 Code graph generation method and system
CN111310876A (en) * 2020-03-18 2020-06-19 中科星图(深圳)数字技术产业研发中心有限公司 Personnel management method and management system for epidemic situation prevention and control
CN111340166A (en) * 2020-03-18 2020-06-26 中科星图(深圳)数字技术产业研发中心有限公司 Method for generating unique identification map
CN112800799A (en) * 2021-01-27 2021-05-14 迅镭智能(广州)科技有限公司 Character conversion system for scanning gun
CN114372547A (en) * 2021-12-22 2022-04-19 广西柳钢东信科技有限公司 Two-dimensional bar code design method for steel serial number identification
CN114372547B (en) * 2021-12-22 2023-10-13 广西柳钢东信科技有限公司 Two-dimensional bar code design method for steel numbering identification

Also Published As

Publication number Publication date
CN107368872B (en) 2019-04-23
WO2017194024A1 (en) 2017-11-16

Similar Documents

Publication Publication Date Title
CN107368872B (en) A kind of method and apparatus generating bar code image
CN104572325B (en) A kind of progressive response sheet disposal method and terminal
CN103455582B (en) The display packing of browser navigation page and mobile terminal
CN107219976A (en) Application display method and related product
CN103702297B (en) Short message enhancement, apparatus and system
CN104899672B (en) Item transfer device, system and method
CN106713116A (en) Information processing method, apparatus and system
CN104616143B (en) Virtual tickets transfer method and device in social networking application
CN104901805B (en) A kind of identification authentication methods, devices and systems
CN104852885A (en) Method, device and system for verifying verification code
CN108958606A (en) Multi-screen display method, device, storage medium and electronic equipment
CN107422962A (en) A kind of bright screen control method and equipment
CN104820546B (en) Function information methods of exhibiting and device
CN106951761A (en) A kind of unlocked by fingerprint method and device
CN109067981A (en) Split screen application switching method, device, storage medium and electronic equipment
CN105446523A (en) Method and apparatus for inputting object in electronic device
CN107590397A (en) A kind of method and apparatus for showing embedded webpage
CN105302804B (en) Display methods, terminal and the server of technical account
CN108984142A (en) Multi-screen display method, device, storage medium and electronic equipment
CN108052356A (en) A kind of method and terminal device for starting calculator
CN107066860A (en) A kind of fingerprint identification method and mobile terminal
CN107423050A (en) A kind of method and apparatus for penetrating operation
US20200258165A1 (en) Method for automatic classification of bill, storage medium, and mobile terminal
CN104636455B (en) The acquisition methods and device of application program map information
CN106055598A (en) Information display method and apparatus

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