CN110619218B - Method and apparatus for generating information - Google Patents

Method and apparatus for generating information Download PDF

Info

Publication number
CN110619218B
CN110619218B CN201811632772.1A CN201811632772A CN110619218B CN 110619218 B CN110619218 B CN 110619218B CN 201811632772 A CN201811632772 A CN 201811632772A CN 110619218 B CN110619218 B CN 110619218B
Authority
CN
China
Prior art keywords
information
processed
category
target object
preset
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.)
Active
Application number
CN201811632772.1A
Other languages
Chinese (zh)
Other versions
CN110619218A (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.)
Beijing Shiguang Renran Technology Co ltd
Original Assignee
Beijing Shiguang Renran Technology 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 Beijing Shiguang Renran Technology Co ltd filed Critical Beijing Shiguang Renran Technology Co ltd
Priority to CN201811632772.1A priority Critical patent/CN110619218B/en
Publication of CN110619218A publication Critical patent/CN110619218A/en
Application granted granted Critical
Publication of CN110619218B publication Critical patent/CN110619218B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a method and a device for generating information. One embodiment of the method comprises: acquiring at least one piece of information to be processed corresponding to a target object; for the information to be processed in the at least one information to be processed, the following steps are executed: determining category information corresponding to the information to be processed from a preset category information set, wherein the category information is used for indicating the category of the information; determining the digit corresponding to the information to be processed, and generating digit information based on the determined digit; forming an information sequence by using the determined category information, the bit number information and the information to be processed, wherein the bit number information is positioned in front of the information to be processed in the information sequence; converting the formed information sequence into binary number; and generating result information corresponding to the target object based on the converted binary number. The embodiment contributes to improving the safety of information transmission and the flexibility of information processing.

Description

Method and apparatus for generating information
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for generating information.
Background
Data encryption is also called cryptography, which is a long-history technology that converts plaintext into ciphertext by an encryption algorithm and an encryption key, and decrypts the ciphertext into plaintext by a decryption algorithm and a decryption key.
Data encryption is one method of protecting information by a computer system. The information is encrypted by utilizing a cryptographic technology, so that the information is concealed, and the effect of protecting the safety of the information is achieved.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating information.
In a first aspect, an embodiment of the present application provides a method for generating information, where the method includes: acquiring at least one piece of information to be processed corresponding to a target object, wherein the information to be processed is used for representing the target object; for the information to be processed in the at least one information to be processed, the following steps are executed: determining category information corresponding to the information to be processed from a preset category information set, wherein the category information is used for indicating the category of the information; determining the digit corresponding to the information to be processed, and generating digit information based on the determined digit; forming an information sequence by using the determined category information, the bit number information and the information to be processed, wherein the bit number information is positioned in front of the information to be processed in the information sequence; converting the formed information sequence into binary number; and generating result information corresponding to the target object based on the converted binary number.
In some embodiments, the method further comprises: and outputting the generated result information corresponding to the target object in response to receiving the information acquisition request aiming at the target object.
In some embodiments, generating result information corresponding to the target object based on the converted binary number includes: in response to determining that the translated binary number includes at least two, composing a resulting binary number using the at least two translated binary numbers; and generating result information corresponding to the target object based on the result binary number.
In some embodiments, the determined category information, the bit number information, and the to-be-processed information are utilized to compose an information sequence, including: and forming an information sequence by using the determined category information, the bit number information and the information to be processed, so that the category information is positioned in front of the bit number information and the bit number information is positioned in front of the information to be processed.
In some embodiments, the category information in the category information set corresponds to preset information in a preset information set; and determining the category information corresponding to the information to be processed from a preset category information set, wherein the determining comprises the following steps: determining preset information matched with the information to be processed from a preset information set; and acquiring the category information corresponding to the determined preset information from the category information set as the category information corresponding to the information to be processed.
In a second aspect, an embodiment of the present application provides an apparatus for generating information, where the apparatus includes: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire at least one piece of information to be processed corresponding to a target object, and the information to be processed is used for representing the target object; an execution unit configured to execute, for information to be processed of the at least one piece of information to be processed, the following steps: determining category information corresponding to the information to be processed from a preset category information set, wherein the category information is used for indicating the category of the information; determining the digit corresponding to the information to be processed, and generating digit information based on the determined digit; forming an information sequence by using the determined category information, the determined digit information and the information to be processed, wherein the digit information is positioned in front of the information to be processed in the information sequence; converting the formed information sequence into binary number; and the generating unit is configured to generate result information corresponding to the target object based on the converted binary number.
In some embodiments, the apparatus further comprises: an output unit configured to output the generated result information corresponding to the target object in response to receiving the information acquisition request for the target object.
In some embodiments, the generating unit comprises: a first generating module configured to compose a result binary number using the converted at least two binary numbers in response to determining that the converted binary number includes at least two; and the second generation module is configured to generate result information corresponding to the target object based on the result binary number.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement the method of any of the embodiments of the method for generating information described above.
In a fourth aspect, the present application provides a computer-readable medium, on which a computer program is stored, which when executed by a processor implements the method of any of the above-described methods for generating information.
According to the method and the device for generating information, at least one piece of to-be-processed information corresponding to a target object is obtained, and then the following steps are executed for the to-be-processed information in the at least one piece of to-be-processed information: determining category information corresponding to the information to be processed from a preset category information set; determining the digit corresponding to the information to be processed, and generating digit information based on the determined digit; forming an information sequence by using the determined category information, the bit number information and the information to be processed, wherein the bit number information is positioned in front of the information to be processed in the information sequence; the formed information sequence is converted into binary number, and finally, the result information corresponding to the target object is generated based on the converted binary number, so that the information to be processed can be encrypted by utilizing the category information and the digit information corresponding to the information to be processed, the encrypted result information is generated, and the safety of information transmission is improved; in addition, because the digit information is positioned before the information to be processed in the information sequence, the result information can be decrypted more conveniently based on the digits indicated by the digit information, which is beneficial to improving the flexibility of information processing.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram to which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for generating information according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a method for generating information according to an embodiment of the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for generating information according to the present application;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for generating information according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the method for generating information or the apparatus for generating information of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices, including but not limited to smart phones, tablet computers, electronic book readers, MP3 players (Moving Picture Experts Group Audio Layer III, mpeg Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, mpeg Audio Layer 4), laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as an information processing server that processes to-be-processed information corresponding to target objects transmitted by the terminal apparatuses 101, 102, 103. The information processing server may perform processing such as analysis on the received data such as the information to be processed, and process the result (e.g., result information corresponding to the target object).
It should be noted that the method for generating information provided in the embodiment of the present application may be executed by the terminal devices 101, 102, and 103, or may be executed by the server 105, and accordingly, the apparatus for generating information may be disposed in the terminal devices 101, 102, and 103, or may be disposed in the server 105.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation. In the case where data used in the process of generating result information corresponding to the target object does not need to be acquired from a remote location, the system architecture may include only a terminal device or a server without a network.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for generating information in accordance with the present application is shown. The method for generating information comprises the following steps:
step 201, at least one piece of information to be processed corresponding to a target object is obtained.
In this embodiment, an execution subject (for example, a server shown in fig. 1) of the method for generating information may acquire at least one piece of to-be-processed information corresponding to the target object through a wired connection manner or a wireless connection manner. The target object is an object to be subjected to encryption processing on the corresponding information to be processed. Specifically, the target object may be various objects, for example, the target object may be a user, a product, a building, or the like. The information to be processed corresponding to the target object is information related to the target object, and can be used for representing the target object. Specifically, as an example, the target object is a target user, and the to-be-processed information corresponding to the target object may include, but is not limited to, at least one of the following: name information, age information and mobile phone number information; or, the target object is a target building, and the to-be-processed information corresponding to the target object may include, but is not limited to, at least one of the following: geographical location information, altitude information, floor space information.
In this embodiment, the execution main body may obtain at least one piece of to-be-processed information, which is pre-stored locally and corresponds to the target object; alternatively, the execution main body may acquire at least one piece of to-be-processed information corresponding to the target object, which is transmitted by the electronic device (for example, the terminal device shown in fig. 1) connected in communication.
Step 202, for the information to be processed in the at least one information to be processed, executing the following steps: determining category information corresponding to the information to be processed from a preset category information set; determining the digit corresponding to the information to be processed, and generating digit information based on the determined digit; forming an information sequence by using the determined category information, the determined digit information and the information to be processed; the composed information sequence is converted into a binary number.
In this embodiment, for the to-be-processed information in the at least one to-be-processed information obtained in step 201, the executing body may execute the following steps:
step 2021, determining category information corresponding to the information to be processed from a preset category information set.
Wherein, the category information is used for indicating the category of the information, and may include but is not limited to at least one of the following: characters, symbols, letters, numbers. As an example, the category information in the set of category information may be letters, each of which may indicate a category of one information. For example, name category is indicated by letter a; the age category is indicated with the letter B; the cell phone number category is indicated by the letter C.
The category information corresponding to the information to be processed may be used to indicate a category of the information to be processed. Here, the execution subject may determine the category information corresponding to the to-be-processed information from the category information set by using various methods. For example, the information to be processed includes a preset category identifier for characterizing a category of the information to be processed, and the execution main body may determine the category of the information to be processed according to the category identifier of the information to be processed, and further select, from a category information set, category information in which an indicated category is the same as the determined category as the category information corresponding to the information to be processed.
In some optional implementation manners of this embodiment, the category information in the category information set corresponds to preset information in a preset information set; the execution main body can determine the category information corresponding to the information to be processed from a preset category information set through the following steps: first, the execution body may determine preset information matching the to-be-processed information from a preset information set. Then, the execution main body may acquire category information corresponding to the determined preset information from the category information set as category information corresponding to the to-be-processed information.
The preset information may be preset information for category information in a category information set, and the category of the preset information is the same as the category indicated by the category information corresponding to the preset information. For example, the category information set includes category information "B" indicating an age category. The preset information corresponding to the category information "B" may include 43 numbers between 18 and 60, and each number may be used to represent an age.
In this implementation manner, the execution subject may determine the preset information matching the to-be-processed information from the preset information set by using various methods. Specifically, as an example, preset information including the information to be processed may be determined from a preset information set as preset information matching the information to be processed. For example, the to-be-processed information is "20", the preset information set includes preset information "18, 19, 20, … … 60", and since the preset information "18, 19, 20, … … 60" includes "20", the preset information "18, 19, 20, … … 60" may be determined as the preset information matching the to-be-processed information "20". Or, similarity calculation may be performed on the information to be processed and preset information in a preset information set, and then preset information with the highest similarity to the information to be processed is obtained as preset information matched with the information to be processed.
It should be noted that the similarity calculation is a well-known technique which is widely studied and applied at present, and is not described herein again.
Step 2022, determine the bit number corresponding to the information to be processed, and generate bit number information based on the determined bit number.
The number of bits corresponding to the information to be processed is the number of bits occupied by the binary number corresponding to the information to be processed after the information to be processed is converted into the binary number. The bit number information is used to characterize the number of bits.
In practice, technicians can preset the corresponding relationship between different types of data and the number of bytes, for example, one Chinese character is usually set to correspond to two bytes; one letter corresponds to one byte; one digit corresponds to one byte. Furthermore, since one byte occupies 8 bits, one Chinese character corresponds to 16 bits; one letter corresponds to 8 bits; one digit corresponds to 8 bits. Therefore, the execution body can determine the bit number corresponding to the information to be processed based on the corresponding relation.
For example, the information to be processed is "three pieces", it is understood that the information to be processed includes two chinese characters, one chinese character corresponds to 16 bits, and the execution main body may determine that the number of bits corresponding to the information to be processed is "16".
In the present embodiment, the execution body described above may generate the bit number information by various methods based on the determined bit number. For example, the execution body may directly determine the determined number of bits as the bit number information; alternatively, the execution body may process the determined number of digits (for example, add a character "digit" after the number of digits), obtain a processing result, and further determine the obtained processing result as digit information.
Step 2023, compose an information sequence using the determined category information, the bit number information, and the information to be processed.
Here, the execution subject described above may constitute an information sequence using the category information determined in step 2021, the bit number information determined in step 2022, and the information to be processed. It should be noted that, in the information sequence, the bit number information needs to be located before the information to be processed; and the position of the category information in the information sequence may be arbitrary.
It can be understood that when the binary number corresponding to the information sequence is decrypted, the binary number corresponding to the information sequenced in the front is decrypted preferentially, and further, the digit information is located before the information to be processed, and the digit corresponding to the information to be processed can be preferentially determined before the information to be processed is decrypted, so that the binary number corresponding to the information to be processed can be determined more conveniently, and the decryption efficiency and accuracy are improved.
In some optional implementation manners of this embodiment, the execution main body may compose an information sequence by using the determined category information, the bit number information, and the to-be-processed information, so that the category information is located before the bit number information, and the bit number information is located before the to-be-processed information.
In this implementation manner, the category information is located before the bit number information, which is helpful for preferentially determining the category of the information to be processed when decrypting the binary number corresponding to the information sequence, so that the information to be processed can be more accurately decrypted.
Step 2024, the composed information sequence is converted into a binary number.
Here, the execution body may convert the information sequence into a binary number based on the information sequence obtained in step 2023. It should be noted that the method for converting an information sequence into a binary number is a well-known technique that is widely researched and applied at present, and is not described herein again.
And step 203, generating result information corresponding to the target object based on the converted binary number.
In this embodiment, based on the binary number converted in step 202, the execution body may generate result information corresponding to the target object. The result information is obtained by encrypting at least one piece of information to be processed corresponding to the target object, and can be used for transmission. It should be noted that, in practice, the at least one piece of information to be processed may be obtained by decrypting the result information.
Specifically, the execution body may generate result information corresponding to the target object based on the converted binary number by using various methods. For example, the execution body may directly determine the converted binary number as result information corresponding to the target object; alternatively, the execution body may process the converted binary number (for example, add a preset number to the last bit of the converted binary number), obtain a processing result, and determine the obtained processing result as result information corresponding to the target object.
In some optional implementations of this embodiment, after generating the result information corresponding to the target object, the execution main body may output the generated result information corresponding to the target object in response to receiving the information acquisition request for the target object. Here, the information acquisition request may be a request for acquiring result information corresponding to the target object, which is transmitted from the electronic device that is communicatively connected to the execution main body. Further, the execution body may output result information corresponding to the target object to the electronic device that transmitted the information acquisition request.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for generating information according to the present embodiment. In the application scenario of fig. 3, first, the server 301 may acquire the to-be-processed information 3021 of the target user (e.g., name information "zhang" of the target user) and the to-be-processed information 3022 (e.g., age information "20" of the target user).
Then, with respect to the to-be-processed information 3021, the server 301 may perform the steps of: determining category information 3041 (for example, a letter a (here, the letter a is used to indicate a name category)) corresponding to the information to be processed from a preset category information set 303; determining the bit number corresponding to the information to be processed (32 (since one Chinese character corresponds to 16 bits, "Zhang three" includes two Chinese characters, corresponding to 32 bits)), and generating bit number information 3051 (for example, "32 bits") based on the determined bit number; using the determined category information 3041, digit information 3051, and the information to be processed 3021, an information sequence 3061 (e.g., "a; 32 bits; zhang san") is composed, in which digit information precedes information to be processed in the information sequence; the composed information sequence 3061 is converted into a binary number 3071.
Similarly, for the to-be-processed information 3022, the server 301 may perform the following steps: determining category information 3042 (e.g., a letter B (here, the letter B is used to indicate an age category)) corresponding to the information to be processed from a preset category information set 303; determining a number of bits (8 (one number corresponds to 8 bits)) corresponding to the information to be processed, and generating bit number information 3052 (e.g., "8 bits") based on the determined number of bits; using the determined category information 3042, digit number information 3052, and the information to be processed 3022, an information sequence 3062 (e.g., "B; 8 bits; 20") is composed; the composed information sequence 3062 is converted into a binary number 3072.
Finally, the server 301 may generate the result information 308 corresponding to the target user based on the converted binary numbers 3071, 3072.
The method provided by the embodiment of the application can encrypt the information to be processed by utilizing the category information and the digit information corresponding to the information to be processed to generate the encrypted result information, thereby being beneficial to improving the safety of information transmission; in addition, because the digit information is positioned before the information to be processed in the information sequence, the result information can be decrypted more conveniently based on the digits indicated by the digit information, which is beneficial to improving the flexibility of information processing.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for generating information is shown. The flow 400 of the method for generating information comprises the steps of:
step 401, at least one piece of information to be processed corresponding to the target object is obtained.
In this embodiment, an execution subject (for example, a server shown in fig. 1) of the method for generating information may acquire at least one piece of to-be-processed information corresponding to the target object through a wired connection manner or a wireless connection manner. The target object is an object to be subjected to encryption processing on the corresponding information to be processed. Specifically, the target object may be various objects, for example, the target object may be a user, a product, a building, or the like. The information to be processed corresponding to the target object is information related to the target object, and can be used for representing the target object.
Step 402, for the information to be processed in the at least one information to be processed, executing the following steps: determining category information corresponding to the information to be processed from a preset category information set; determining the digit corresponding to the information to be processed, and generating digit information based on the determined digit; forming an information sequence by using the determined category information, the determined digit information and the information to be processed; the composed information sequence is converted into a binary number.
In this embodiment, for the to-be-processed information in the at least one to-be-processed information obtained in step 401, the executing body may execute the following steps:
step 4021, determining category information corresponding to the information to be processed from a preset category information set.
Wherein, the category information is used for indicating the category of the information, and may include but is not limited to at least one of the following: characters, symbols, letters, numbers.
Step 4022, determining the number of bits corresponding to the information to be processed, and generating bit number information based on the determined number of bits.
The number of bits corresponding to the information to be processed is the number of bits occupied by the binary number corresponding to the information to be processed after the information to be processed is converted into the binary number. The bit number information is used to characterize the number of bits.
Step 4023, forming an information sequence by using the determined category information, the determined bit number information and the information to be processed.
Here, the execution subject described above may compose an information sequence using the category information determined in step 4021, the bit number information determined in step 4022, and the information to be processed. It should be noted that, in the information sequence, the bit number information needs to be located before the information to be processed; and the position of the category information in the information sequence may be arbitrary.
Step 4024, converting the composed information sequence into binary numbers.
Here, the execution body may convert the information sequence into a binary number based on the information sequence obtained in step 4023.
Steps 401 and 402 are the same as steps 201 and 202 in the foregoing embodiment, respectively, and the description above for steps 201 and 202 also applies to steps 401 and 402, which are not described again here.
In response to determining that the converted binary numbers include at least two, the resulting binary numbers are formed using the converted at least two binary numbers, step 403.
In this embodiment, the execution body may compose the result binary number using the at least two binary numbers converted into the binary numbers in response to the determination step 402 including at least two. For example, if the translated binary numbers include "11111110" and "10000000," the execution body may compose the result binary number "1111111010000000" using "11111110" and "10000000. It should be noted that, here, the resulting binary number is a binary number formed by connecting at least two binary numbers end to end, and the arrangement position of each converted binary number in the resulting binary number may be arbitrary, and is not limited herein.
Step 404, generating result information corresponding to the target object based on the result binary number.
In this embodiment, based on the result binary number composed in step 403, the execution body may generate result information corresponding to the target object. The result information is obtained by encrypting at least one piece of information to be processed corresponding to the target object, and can be used for transmission. It should be noted that, in practice, the at least one piece of information to be processed may be obtained by decrypting the result information.
Specifically, the execution body may adopt various methods to generate result information corresponding to the target object based on the result binary number. For example, the execution body may directly determine the result binary number as the result information corresponding to the target object; alternatively, the execution body may process the result binary number (for example, add a preset number to the last bit of the result binary number), obtain a processing result, and determine the obtained processing result as the result information corresponding to the target object.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for generating information in the present embodiment highlights a step of composing a result binary number with at least two binary numbers in response to determining that the converted binary numbers include at least two, and then generating result information corresponding to the target object based on the result binary number. Therefore, the scheme described in the embodiment can generate more complex result information based on the result binary number, which is helpful for further improving the security of information transmission.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for generating information, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for generating information of the present embodiment includes: an acquisition unit 501, an execution unit 502, and a generation unit 503. The obtaining unit 501 is configured to obtain at least one piece of information to be processed corresponding to a target object, where the information to be processed is used to represent the target object; the execution unit 502 is configured to, for information to be processed of the at least one information to be processed, perform the following steps: determining category information corresponding to the information to be processed from a preset category information set, wherein the category information is used for indicating the category of the information; determining the digit corresponding to the information to be processed, and generating digit information based on the determined digit; forming an information sequence by using the determined category information, the bit number information and the information to be processed, wherein the bit number information is positioned in front of the information to be processed in the information sequence; converting the formed information sequence into binary number; and the generating unit is configured to generate result information corresponding to the target object based on the converted binary number.
In this embodiment, the obtaining unit 501 of the apparatus 500 for generating information may obtain at least one piece of information to be processed corresponding to the target object through a wired connection manner or a wireless connection manner. The target object is an object to be subjected to encryption processing on the information to be processed corresponding to the target object. Specifically, the target object may be various objects, for example, the target object may be a user, a product, a building, or the like. The information to be processed corresponding to the target object is information related to the target object, and can be used for representing the target object. Specifically, as an example, the target object is a target user, and the to-be-processed information corresponding to the target object may include, but is not limited to, at least one of the following: name information, age information and mobile phone number information; or, the target object is a target building, and the to-be-processed information corresponding to the target object may include, but is not limited to, at least one of the following: geographical location information, altitude information, floor space information.
In this embodiment, for the to-be-processed information in the at least one to-be-processed information obtained by the obtaining unit 501, the executing unit 502 may perform the following steps:
step one, determining category information corresponding to the information to be processed from a preset category information set.
Wherein, the category information is used for indicating the category of the information, and may include but is not limited to at least one of the following: characters, symbols, letters, numbers. As an example, the category information in the set of category information may be letters, each of which may indicate a category of one information. For example, name category is indicated by letter a; the age category is indicated with the letter B; the cell phone number category is indicated by the letter C.
And step two, determining the digit corresponding to the information to be processed, and generating digit information based on the determined digit.
The number of bits corresponding to the information to be processed is the number of bits occupied by the binary number corresponding to the information to be processed after the information to be processed is converted into the binary number. The bit number information is used to characterize the number of bits.
And step three, forming an information sequence by using the determined category information, the determined digit information and the information to be processed.
Here, the execution unit 502 may compose an information sequence using the category information determined in the step one, the bit number information determined in the step two, and the information to be processed. It should be noted that, in the information sequence, the bit number information needs to be located before the information to be processed; and the position of the category information in the information sequence may be arbitrary.
And step four, converting the formed information sequence into binary numbers.
Here, based on the information sequence obtained in step three, the execution unit 502 may convert the information sequence into a binary number.
In this embodiment, the generating unit 503 may generate result information corresponding to the target object based on the binary number converted by the executing unit 502. The result information is obtained by encrypting at least one piece of information to be processed corresponding to the target object, and can be used for transmission. It should be noted that, in practice, the at least one piece of information to be processed may be obtained by decrypting the result information.
In some optional implementations of this embodiment, the apparatus 500 may further include: an output unit (not shown in the figure) configured to output the generated result information corresponding to the target object in response to receiving the information acquisition request for the target object.
In some optional implementations of this embodiment, the generating unit 503 may include: a first generation module (not shown in the figures) configured to compose a result binary number using the converted at least two binary numbers in response to determining that the converted binary number includes at least two; and a second generating module (not shown in the figure) configured to generate result information corresponding to the target object based on the result binary number.
In some optional implementations of this embodiment, the execution unit 502 may be further configured to: and forming an information sequence by using the determined category information, the determined digit information and the information to be processed, so that the category information is positioned in front of the digit information and the digit information is positioned in front of the information to be processed.
In some optional implementation manners of this embodiment, the category information in the category information set corresponds to preset information in a preset information set; and the execution unit 502 may be further configured to: determining preset information matched with the information to be processed from a preset information set; and acquiring the category information corresponding to the determined preset information from the category information set as the category information corresponding to the information to be processed.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
The device 500 provided by the above embodiment of the present application may encrypt the information to be processed by using the category information and the bit information corresponding to the information to be processed, and generate the encrypted result information, which is helpful for improving the security of information transmission; in addition, because the digit information is positioned before the information to be processed in the information sequence, the result information can be easily decrypted based on the digit indicated by the digit information, which is beneficial to improving the flexibility of information processing.
Referring now to fig. 6, a schematic diagram of an electronic device (e.g., a terminal device or a server in fig. 1) 600 suitable for implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least one piece of to-be-processed information corresponding to a target object, wherein the to-be-processed information is used for representing the target object; for the information to be processed in the at least one information to be processed, the following steps are executed: determining category information corresponding to the information to be processed from a preset category information set, wherein the category information is used for indicating the category of the information; determining the digit corresponding to the information to be processed, and generating digit information based on the determined digit; forming an information sequence by using the determined category information, the determined digit information and the information to be processed, wherein the digit information is positioned in front of the information to be processed in the information sequence; converting the formed information sequence into binary number; and generating result information corresponding to the target object based on the converted binary number.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Here, the name of the unit does not constitute a limitation of the unit itself in some cases, and for example, the acquisition unit may also be described as a "unit that acquires information to be processed".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other combinations of features described above or equivalents thereof without departing from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (9)

1. A method for generating information, comprising:
acquiring at least one piece of information to be processed corresponding to a target object, wherein the information to be processed is used for representing the target object;
for the information to be processed in the at least one information to be processed, executing the following steps: determining category information corresponding to the information to be processed from a preset category information set, wherein the determining includes: determining preset information matched with the information to be processed from a preset information set; acquiring category information corresponding to the determined preset information from the category information set as category information corresponding to the information to be processed, wherein the category information in the category information set corresponds to the preset information in a preset information set, the preset information is preset information aiming at the category information in the category information set, and the category information is used for indicating the category of the information to be processed; determining the corresponding digit after the information to be processed is converted into binary number, and generating digit information based on the determined digit; forming an information sequence by using the determined category information, the determined digit information and the information to be processed, wherein the digit information is positioned in front of the information to be processed in the information sequence; converting the formed information sequence into binary number;
and generating result information corresponding to the target object based on the converted binary number.
2. The method of claim 1, wherein the method further comprises:
and responding to the received information acquisition request aiming at the target object, and outputting the generated result information corresponding to the target object.
3. The method of claim 1, wherein generating result information corresponding to the target object based on the converted binary number comprises:
in response to determining that the translated binary number includes at least two, composing a resulting binary number using the at least two translated binary numbers;
and generating result information corresponding to the target object based on the result binary number.
4. The method of claim 1, wherein the composing an information sequence using the determined category information, bit number information, and the information to be processed comprises:
and forming an information sequence by using the determined category information, the bit number information and the information to be processed, so that the category information is positioned in front of the bit number information, and the bit number information is positioned in front of the information to be processed.
5. An apparatus for generating information, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire at least one piece of information to be processed corresponding to a target object, and the information to be processed is used for representing the target object;
an execution unit configured to execute, for information to be processed in the at least one piece of information to be processed, the following steps: determining category information corresponding to the information to be processed from a preset category information set, wherein the category information is used for indicating the category of the information to be processed; determining the corresponding digit after the information to be processed is converted into binary number, and generating digit information based on the determined digit; forming an information sequence by using the determined category information, the determined digit information and the information to be processed, wherein the digit information is positioned in front of the information to be processed in the information sequence; converting the formed information sequence into binary number;
a generating unit configured to generate result information corresponding to the target object based on the converted binary number;
the execution unit is further configured to determine preset information matched with the information to be processed from a preset information set; and acquiring category information corresponding to the determined preset information from the category information set as the category information corresponding to the information to be processed, wherein the category information in the category information set corresponds to the preset information in a preset information set, and the preset information is preset information aiming at the category information in the category information set.
6. The apparatus of claim 5, wherein the apparatus further comprises:
an output unit configured to output the generated result information corresponding to the target object in response to receiving an information acquisition request for the target object.
7. The apparatus of claim 5, wherein the generating unit comprises:
a first generating module configured to compose a result binary number using the converted at least two binary numbers in response to determining that the converted binary number includes at least two;
and the second generation module is configured to generate result information corresponding to the target object based on the result binary number.
8. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
9. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201811632772.1A 2018-12-29 2018-12-29 Method and apparatus for generating information Active CN110619218B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811632772.1A CN110619218B (en) 2018-12-29 2018-12-29 Method and apparatus for generating information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811632772.1A CN110619218B (en) 2018-12-29 2018-12-29 Method and apparatus for generating information

Publications (2)

Publication Number Publication Date
CN110619218A CN110619218A (en) 2019-12-27
CN110619218B true CN110619218B (en) 2022-07-12

Family

ID=68920090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811632772.1A Active CN110619218B (en) 2018-12-29 2018-12-29 Method and apparatus for generating information

Country Status (1)

Country Link
CN (1) CN110619218B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750268A (en) * 2012-06-19 2012-10-24 山东中创软件商用中间件股份有限公司 Object serializing method as well as object de-serializing method, device and system
CN104376356A (en) * 2014-12-02 2015-02-25 合肥城市云数据中心有限公司 Two-dimensional code generating method with encryption function
CN106161006A (en) * 2015-04-06 2016-11-23 汪风珍 A kind of digital encryption algorithm
CN107341262A (en) * 2017-07-14 2017-11-10 上海达梦数据库有限公司 The serializing of object type row, unserializing method and device in database
CN108446319A (en) * 2018-02-09 2018-08-24 烽火通信科技股份有限公司 Data are carried out to the method and system of Binary Serialization

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6907435B2 (en) * 2001-02-27 2005-06-14 Microsoft Corporation Converting numeric values to strings for optimized database storage
CN108804933B (en) * 2018-05-25 2020-06-05 东北大学 Method for carrying out scale conversion on big data in information hiding technology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750268A (en) * 2012-06-19 2012-10-24 山东中创软件商用中间件股份有限公司 Object serializing method as well as object de-serializing method, device and system
CN104376356A (en) * 2014-12-02 2015-02-25 合肥城市云数据中心有限公司 Two-dimensional code generating method with encryption function
CN106161006A (en) * 2015-04-06 2016-11-23 汪风珍 A kind of digital encryption algorithm
CN107341262A (en) * 2017-07-14 2017-11-10 上海达梦数据库有限公司 The serializing of object type row, unserializing method and device in database
CN108446319A (en) * 2018-02-09 2018-08-24 烽火通信科技股份有限公司 Data are carried out to the method and system of Binary Serialization

Also Published As

Publication number Publication date
CN110619218A (en) 2019-12-27

Similar Documents

Publication Publication Date Title
CN109150499B (en) Method and device for dynamically encrypting data, computer equipment and storage medium
CN107248984B (en) Data exchange system, method and device
CN110516462B (en) Method and apparatus for encrypting data
CN111199037B (en) Login method, system and device
CN110705985B (en) Method and apparatus for storing information
CN111245811A (en) Information encryption method and device and electronic equipment
CN111030827A (en) Information interaction method and device, electronic equipment and storage medium
CN112149168A (en) File data encryption method and device and electronic equipment
CN110545542B (en) Main control key downloading method and device based on asymmetric encryption algorithm and computer equipment
CN114006769A (en) Model training method and device based on horizontal federal learning
CN112329044A (en) Information acquisition method and device, electronic equipment and computer readable medium
CN111130791B (en) Data signature method, electronic device and computer readable storage medium
CN111010283B (en) Method and apparatus for generating information
CN111767550A (en) Data storage method and device
CN110765238A (en) Data encryption query method and device
CN111130805A (en) Secure transmission method, electronic device, and computer-readable storage medium
CN110619218B (en) Method and apparatus for generating information
CN115834025A (en) Data encryption method, equipment and storage medium for automobile diagnosis platform
CN112242978B (en) Method and device for processing data
CN114726611A (en) Multiparty privacy set intersection method, system and device
CN110492998B (en) Method for encrypting and decrypting data
CN109756506A (en) Data ciphering method, device, equipment and storage medium based on GNSS receiver
CN115378743B (en) Information encryption transmission method, device, equipment and medium
CN112468470B (en) Data transmission method and device and electronic equipment
CN111314320B (en) Communication method, terminal, server and system based on HTTP

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