CN109753227B - Storage method, device, mobile terminal, server and readable storage medium - Google Patents

Storage method, device, mobile terminal, server and readable storage medium Download PDF

Info

Publication number
CN109753227B
CN109753227B CN201711092700.8A CN201711092700A CN109753227B CN 109753227 B CN109753227 B CN 109753227B CN 201711092700 A CN201711092700 A CN 201711092700A CN 109753227 B CN109753227 B CN 109753227B
Authority
CN
China
Prior art keywords
preset
data type
stored
data
bits
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
CN201711092700.8A
Other languages
Chinese (zh)
Other versions
CN109753227A (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 Didi Infinity Technology and Development Co Ltd
Original Assignee
Beijing Didi Infinity Technology and Development 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 Didi Infinity Technology and Development Co Ltd filed Critical Beijing Didi Infinity Technology and Development Co Ltd
Priority to CN201711092700.8A priority Critical patent/CN109753227B/en
Publication of CN109753227A publication Critical patent/CN109753227A/en
Application granted granted Critical
Publication of CN109753227B publication Critical patent/CN109753227B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a storage method and a storage device for user evaluation results, a mobile terminal, a server and a readable storage medium, wherein the storage method for the user evaluation results comprises the following steps: acquiring scoring values for a plurality of evaluation items; converting the plurality of scoring values into at least one numerical string to be stored; determining a preset threshold interval corresponding to each numerical string so as to determine a corresponding data type according to the preset threshold interval; converting the numerical string to be stored into storage data according to the data type; and sending the stored data to a server so that the server stores a plurality of scores according to the number of bytes of the stored data. The technical scheme of the invention is beneficial to reducing the storage space, thereby reducing the storage pressure of the server side.

Description

Storage method, device, mobile terminal, server and readable storage medium
Technical Field
The invention relates to the technical field of dispatching capacity, in particular to a storage method of user evaluation results, a storage device of the user evaluation results, a mobile terminal, a server and a computer readable storage medium.
Background
In the related art, the storage of the user evaluation results is to record the evaluation score of an item by using one byte for different items of evaluation, for example, by using one byte (i.e., a char type including 8 bits, which represents a range of 0 to 255 in 10 systems or-128 to 127) for recording, which has the advantages that the evaluation score can be subdivided, for example, into 0 to 100 points, and the following defects exist:
the storage space is occupied by comparison, at present, in many applications requiring user evaluation, the evaluated items are usually more, but the score of each evaluation is only 1-5, that is, the evaluation is not particularly detailed, for example, when there are 4 evaluation items, 4 bytes are needed for storage, and when there are more items requiring evaluation, more bytes are needed for storage, which results in a large amount of occupied storage space.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art or the related art.
To this end, the present invention aims to provide a method for storing user evaluation results, a device for storing user evaluation results, a mobile terminal, a server and a computer-readable storage medium.
In order to achieve the above object, a first aspect of the present invention provides a method for storing user evaluation results, which is applicable to a network appointment client, and includes: acquiring scoring values for a plurality of evaluation items; converting the plurality of scoring values into at least one numerical string to be stored; determining a preset threshold interval corresponding to each numerical string so as to determine a corresponding data type according to the preset threshold interval; converting the numerical string to be stored into storage data according to the data type; and sending the stored data to a server so that the server stores a plurality of scores according to the number of bytes of the stored data.
In the technical scheme, after the score values of a user for a plurality of evaluation items are obtained, the plurality of score values are converted into one or more multi-bit data, namely a numerical string, and the relationship between the number of bits of the numerical string and a preset grouping number threshold is detected, so that when the number of bits of the numerical string is detected to be smaller than the preset grouping number threshold, a preset threshold interval corresponding to the numerical string is directly determined, and therefore a corresponding data type is determined according to the preset threshold interval, a storage identifier is stored according to the data type and is sent to a server for storage.
When the scoring values are all single digits, the digits of the numerical string are the same as the number of the evaluation items.
In addition, the score value may be a score of 1 to 100 points of the fine score, a score of 1 to 15 points of the coarser score, a score of 1 to 10 points of the coarser score, or a score of 1 to 5 points of the coarser score.
Specifically, the minimum unit of computer storage is byte at present, and each byte contains 8 bits (each bit can take a value of 0 or 1).
For the char type, the representation occupies one byte in the memory, i.e. 8 bits, which can represent 0-255 (or-128-127), and can store the scoring values of 2 items.
The short type representation occupies two bytes in the memory, namely 16 bits, and can represent 0-65535 (or-32768-32767), and the score values of 4 items can be stored at most.
int type, which represents that 4 bytes are occupied in the memory, namely 32 bits, 0-4294967295 (or-2147483648-2147483647), and can store the credit values of 9 items at most.
The double type represents that 8 bytes are occupied in the memory, and 64 bits are occupied.
For example, if there are 4 evaluation items with scores of 5, 5, 5, and 5, respectively, if the storage method in the prior art is used, since each number needs one byte, 4 bytes are needed, each byte stores one score, and by generating a numerical string, the 4 scores can be converted into decimal numbers (or octal numbers), i.e., 5555, where each digit of the decimal numbers represents one score, and since 5555 is smaller than 65535, the scores of the four evaluation items can be represented by using two bytes (short type), which saves half of the storage space compared with the conventional method. As above, four bytes (int type) maximally represents 10 digits, and then scores of 9 evaluation items (each score of the evaluation item is less than 10) can be stored at most, which saves 5 bytes compared with the conventional method.
The technical solution of the second aspect of the present invention provides a method for storing user evaluation results, which is applicable to a server, and includes: receiving the scoring values aiming at the plurality of evaluation items sent by the online taxi appointment client; converting the plurality of scoring values into at least one numerical string to be stored; determining a preset threshold interval corresponding to each numerical string so as to determine a corresponding data type according to the preset threshold interval; and storing the numerical value string to be stored according to the data type.
In the technical scheme, after receiving the scoring values of a plurality of evaluation items sent by the terminal, the plurality of scoring values are converted into one or more pieces of multi-bit data, i.e. a numerical string, and detecting the relationship between the number of bits of the numerical string and a preset packet number threshold, to directly determine a preset threshold interval corresponding to the numerical string when the number of bits of the numerical string is detected to be less than the preset packet number threshold, thereby determining the corresponding data type according to the preset threshold interval, carrying out storage identification according to the data type, sending the data type to a server for storage, compared with the prior art of recording one credit value by one byte, the method helps to reduce the storage space, therefore, the storage pressure of the server side is reduced, compared with the technical scheme of the first aspect of the invention, the data processing and conversion process is completed at the server side, and the processing pressure of the mobile terminal can be reduced.
When the scoring values are all single digits, the digits of the numerical string are the same as the number of the evaluation items.
In addition, the score value may be a score of 1 to 100 points of the fine score, a score of 1 to 15 points of the coarser score, a score of 1 to 10 points of the coarser score, or a score of 1 to 5 points of the coarser score.
Specifically, the minimum unit of computer storage is byte at present, and each byte contains 8 bits (each bit can take a value of 0 or 1).
For the char type, the representation occupies one byte in the memory, i.e. 8 bits, which can represent 0-255 (or-128-127), and can store the scoring values of 2 items.
The short type representation occupies two bytes in the memory, namely 16 bits, and can represent 0-65535 (or-32768-32767), and the score values of 4 items can be stored at most.
int type, which represents that 4 bytes are occupied in the memory, namely 32 bits, 0-4294967295 (or-2147483648-2147483647), and can store the credit values of 9 items at most. The double type represents that 8 bytes are occupied in the memory, and 64 bits are occupied.
In the above technical solution, preferably, the converting the plurality of score values into at least one numerical string to be stored specifically includes the following steps: detecting whether the number of bits of the plurality of credit values is less than or equal to a preset packet number threshold value; when detecting that the number of bits of the plurality of scoring values is smaller than or equal to a preset grouping number threshold value, converting the plurality of scoring values into a numerical string; and when the digit of the plurality of scoring values is detected to be larger than a preset grouping quantity threshold value, grouping the evaluation items, and generating a plurality of data to be stored according to the corresponding data types after grouping, wherein the highest bit in each data to be stored represents a grouping serial number.
In the technical scheme, when the digit of the numerical string is detected to be larger than the threshold value of the preset grouping number, the evaluation items are grouped to store the plurality of score values after grouping, when the evaluation items are more, the generated numerical string does not fall into the value range specified by the preset data type (such as the numerical range specified by the double type), so that the data cannot be stored by adopting the preset data type, and through grouping processing, on one hand, the smooth storage of the plurality of score values is realized, on the other hand, the highest-order bit in each data to be stored represents the grouping number to represent different groups, and the subsequent query and processing of the data are facilitated.
The grouped numerical value strings can be stored according to the same data type or different data types.
When the number of packets exceeds 10, the first two bits of the highest bit are used to represent the packet sequence number.
In any of the above technical solutions, preferably, when it is detected that the number of bits of the plurality of score values is greater than a preset grouping number threshold, the evaluation items are grouped, so that after grouping, a plurality of data to be stored are generated according to corresponding data types, specifically including the following steps: and when the preset grouping quantity threshold is a first preset quantity threshold, determining the quantity of the grouping according to a first preset data type when the quantity of the evaluation items is detected to be larger than the first preset quantity threshold, wherein the first preset quantity threshold is 9, and the first preset data type is an int data type or a short data type.
In the technical scheme, the first preset number threshold is limited to 9, the data type is preset to be int type or short type, when the number of bits of the numerical string is larger than 9, the grouping number is determined according to a quotient value between the number of bits and the storage number of bits corresponding to int type data, and corresponding grouping codes (sequential identification from 0) are generated, so that when the number of bits of the numerical string is smaller than 36 bits, the numerical string is grouped and stored, and the data type is reasonably determined, so that the numerical string is optimally stored, and the storage space is effectively reduced.
The short data type is 16 storage units and the int data type is 32 storage units.
For example, when the evaluation values are all single-digit numbers, if the evaluation items exceed 9 items, for example, 15 items, after the evaluation items are grouped, 2 identifiers of 4 bytes (int type) may be used, or one int type and 2 short types, or 4 bytes of two bytes (short types), where the highest bits (e.g., 0, 1, 2, 3) of each number represent different evaluation item groups.
If it is an assessment with a score of no more than 9 points per assessment, then a maximum of 36 assessment items' scores can be stored using 4 int-types (the highest bits of each int-type number can be 0, 1, 2, 3, respectively, to represent different groupings).
In addition, the double type (8 bytes) representation may be used without performing the grouping.
In any of the above technical solutions, preferably, when it is detected that the number of bits of the plurality of score values is greater than a preset grouping number threshold, the evaluation items are grouped, so that after grouping, a plurality of data to be stored are generated according to corresponding data types, specifically including the following steps: and when the preset grouping quantity threshold is a second preset quantity threshold, determining the quantity of the grouping according to a second preset data type when the quantity of the evaluation items is detected to be larger than the second preset quantity threshold, wherein the second preset quantity threshold is 36, and the second preset data type is a double data type or an int data type.
In the technical scheme, the first preset number threshold is limited to 36, the data type is preset to be int type or short type, when the digit of the numerical string is greater than 36, the grouping number is determined according to the quotient between the digit and the storage digit corresponding to the int type data, and the corresponding grouping code (sequential identification from 0) is generated, so that when the digit of the numerical string is greater (greater than 36), the numerical string is grouped and stored, and the data type is reasonably determined, so that the optimized storage of the numerical string is further realized, and the storage space is effectively reduced.
In addition, if there are more than 36 items to be evaluated, the first two bits of the int type can be used to represent grouping to store scores of more evaluation items.
The int data type is 32 storage units, and the double data type is 64 storage units, i.e. 64 bits are used to store one data.
In any of the above technical solutions, preferably, the generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item specifically includes the following steps: and generating a decimal numerical string according to the number of the plurality of evaluation items and the score value of each evaluation item.
According to the technical scheme, a decimal numerical string is directly generated according to the number of a plurality of evaluation items and the score value of each evaluation item, the score values are usually expressed in decimal numbers, the score values are directly generated into the numerical string according to a preset sequence, then whether the numerical string is split into the numerical strings or not is determined according to a preset grouping number threshold, then the corresponding data type is determined according to a preset threshold interval, and finally storage is achieved, and the processing process is simple.
In any of the above technical solutions, preferably, the generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item specifically includes the following steps: determining a scale of the score value according to a maximum value among the score values of each of the evaluation items to generate the numerical string according to the scale, wherein the scale is octal or decimal when the maximum value is less than 8, decimal or hexadecimal when the maximum value is greater than or equal to 8 and less than 10, and hexadecimal when the maximum value is greater than or equal to 10 and less than or equal to 15.
In the technical scheme, the scale system mode of the score value is determined according to the maximum value of the score value of each evaluation item to determine the proper representation mode, and compared with the mode of only adopting decimal system, on one hand, the use range is wider, and on the other hand, the storage space can be further saved through the conversion of the numerical strings among different scale systems.
One byte is the space occupied by one English letter or Arabic number, and the representation of data in the computer exists in a binary form finally, namely the data stored in the computer is stored in the form of bytes, namely 8 binary codes, but not in the form of binary codes, so that the data can be regarded as being displayed to a processor (such as a processor) in the data processing process no matter whether the data is in the octal, decimal or hexadecimal form.
Specifically, when the plurality of scores are 10, 12, 15, 8, and 6, respectively, the string generated according to the decimal system is 10121586, and the corresponding hexadecimal values are a, C, F, 8, and 6, that is, the string generated according to the hexadecimal system is ACF86 (converted to the decimal number of 6+ 8+ 16+15 + 16+12 + 16+ 655360+49152+3840+128+ 708486), the storage space can be further saved during storage, but a conversion process is added.
The technical solution of the third aspect of the present invention provides a storage device for user evaluation results, which is suitable for a network car booking client, and includes: an acquisition unit configured to acquire score values for a plurality of evaluation items; the conversion unit is used for converting the plurality of scoring values into at least one numerical string to be stored; the determining unit is used for determining a preset threshold interval corresponding to each numerical string so as to determine a corresponding data type according to the preset threshold interval; the conversion unit is further configured to: converting the numerical string to be stored into storage data according to the data type; and the sending unit is used for sending the storage data to the server so that the server stores a plurality of scores according to the storage byte number of the storage data.
In the technical scheme, after the score values of a user for a plurality of evaluation items are obtained, the plurality of score values are converted into a multi-bit data, namely a numerical string, the relationship between the number of bits of the numerical string and a preset grouping number threshold is detected, when the number of bits of the numerical string is detected to be smaller than the preset grouping number threshold, a preset threshold interval corresponding to the numerical string is directly determined, so that a corresponding data type is determined according to the preset threshold interval, a storage identifier is stored according to the data type and is sent to a server for storage, and compared with the mode that one score value is recorded by one byte in the prior art, the method is beneficial to reducing the storage space, and therefore the storage pressure of the server is reduced.
When the scoring values are all single digits, the digits of the numerical string are the same as the number of the evaluation items.
In addition, the score value may be a score of 1 to 100 points of the fine score, a score of 1 to 15 points of the coarser score, a score of 1 to 10 points of the coarser score, or a score of 1 to 5 points of the coarser score.
Specifically, the minimum unit of computer storage is byte at present, and each byte contains 8 bits (each bit can take a value of 0 or 1).
For the char type, the representation occupies one byte in the memory, i.e. 8 bits, which can represent 0-255 (or-128-127), and can store the scoring values of 2 items.
The short type representation occupies two bytes in the memory, namely 16 bits, and can represent 0-65535 (or-32768-32767), and the score values of 4 items can be stored at most.
int type, which represents that 4 bytes are occupied in the memory, namely 32 bits, 0-4294967295 (or-2147483648-2147483647), and can store the credit values of 9 items at most.
The double type represents that 8 bytes are occupied in the memory, and 64 bits are occupied.
For example, if there are 4 evaluation items with scores of 5, 5, 5, and 5, respectively, if the storage method in the prior art is used, since each number needs one byte, 4 bytes are needed, each byte stores one score, and by generating a numerical string, the 4 scores can be converted into decimal numbers (or octal numbers), i.e., 5555, where each digit of the decimal numbers represents one score, and since 5555 is smaller than 65535, the scores of the four evaluation items can be represented by using two bytes (short type), which saves half of the storage space compared with the conventional method. As above, four bytes (int type) maximally represents 10 digits, and then scores of 9 evaluation items (each score of the evaluation item is less than 10) can be stored at most, which saves 5 bytes compared with the conventional method.
A fourth aspect of the present invention provides a storage apparatus for user evaluation results, which is applicable to a server, and includes: the receiving unit is used for receiving the scoring values aiming at the plurality of evaluation items sent by the network car booking client; the conversion unit is used for converting the plurality of scoring values into at least one numerical string to be stored; the determining unit is used for determining a preset threshold interval corresponding to each numerical string so as to determine a corresponding data type according to the preset threshold interval; and the storage unit is used for storing the numerical value string to be stored according to the data type.
In the technical scheme, after receiving the scoring values of a plurality of evaluation items sent by the terminal, the plurality of scoring values are converted into one multi-bit data, i.e. a numerical string, and detecting the relationship between the number of bits of the numerical string and a preset packet number threshold, to directly determine a preset threshold interval corresponding to the numerical string when the number of bits of the numerical string is detected to be less than the preset packet number threshold, thereby determining the corresponding data type according to the preset threshold interval, carrying out storage identification according to the data type, sending the data type to a server for storage, compared with the prior art of recording one credit value by one byte, the method helps to reduce the storage space, therefore, the storage pressure of the server side is reduced, compared with the technical scheme of the first aspect of the invention, the data processing and conversion process is completed at the server side, and the processing pressure of the mobile terminal can be reduced.
When the scoring values are all single digits, the digits of the numerical string are the same as the number of the evaluation items.
In addition, the score value may be a score of 1 to 100 points of the fine score, a score of 1 to 15 points of the coarser score, a score of 1 to 10 points of the coarser score, or a score of 1 to 5 points of the coarser score.
Specifically, the minimum unit of computer storage is byte at present, and each byte contains 8 bits (each bit can take a value of 0 or 1).
For the char type, the representation occupies one byte in the memory, i.e. 8 bits, which can represent 0-255 (or-128-127), and can store the scoring values of 2 items.
The short type representation occupies two bytes in the memory, namely 16 bits, and can represent 0-65535 (or-32768-32767), and the score values of 4 items can be stored at most.
int type, which represents that 4 bytes are occupied in the memory, namely 32 bits, 0-4294967295 (or-2147483648-2147483647), and can store the credit values of 9 items at most.
The double type represents that 8 bytes are occupied in the memory, and 64 bits are occupied.
In the above technical solution, preferably, the method further includes: a detection unit for detecting whether the number of bits of the plurality of score values is less than or equal to a preset packet number threshold; the conversion unit is further configured to: when detecting that the number of bits of the plurality of scoring values is smaller than or equal to a preset grouping number threshold value, converting the plurality of scoring values into a numerical string; the storage device further includes: and the grouping unit is used for grouping the evaluation items when detecting that the number of bits of the plurality of score values is larger than a preset grouping number threshold value, so as to generate a plurality of data to be stored according to the corresponding data types after grouping, wherein the highest bit in each data to be stored represents a grouping serial number.
In the technical scheme, when the digit of the numerical string is detected to be larger than the threshold value of the preset grouping number, the evaluation items are grouped to store the plurality of score values after grouping, when the evaluation items are more, the generated numerical string does not fall into the value range specified by the preset data type (such as the numerical range specified by the double type), so that the data cannot be stored by adopting the preset data type, and through grouping processing, on one hand, the smooth storage of the plurality of score values is realized, on the other hand, the highest-order bit in each data to be stored represents the grouping number to represent different groups, and the subsequent query and processing of the data are facilitated.
The grouped numerical value strings can be stored according to the same data type or different data types.
When the number of packets exceeds 10, the first two bits of the highest bit are used to represent the packet sequence number.
In any of the above technical solutions, preferably, the determining unit is further configured to: and when the preset grouping quantity threshold is a first preset quantity threshold, determining the quantity of the grouping according to a first preset data type when the quantity of the evaluation items is detected to be larger than the first preset quantity threshold, wherein the first preset quantity threshold is 9, and the first preset data type is an int data type or a short data type.
In the technical scheme, the first preset number threshold is limited to 9, the data type is preset to be int type or short type, when the number of bits of the numerical string is larger than 9, the grouping number is determined according to a quotient value between the number of bits and the storage number of bits corresponding to int type data, and corresponding grouping codes (sequential identification from 0) are generated, so that when the number of bits of the numerical string is smaller than 36 bits, the numerical string is grouped and stored, and the data type is reasonably determined, so that the numerical string is optimally stored, and the storage space is effectively reduced.
The short data type is 16 storage units and the int data type is 32 storage units.
For example, when the evaluation values are all single-digit numbers, if the evaluation items exceed 9 items, for example, 15 items, after the evaluation items are grouped, 2 identifiers of 4 bytes (int type) may be used, or one int type and 2 short types, or 4 bytes of two bytes (short types), where the highest bits (e.g., 0, 1, 2, 3) of each number represent different evaluation item groups.
If it is an assessment with a score of no more than 9 points per assessment, then a maximum of 36 assessment items' scores can be stored using 4 int-types (the highest bits of each int-type number can be 0, 1, 2, 3, respectively, to represent different groupings).
In addition, the double type (8 bytes) representation may be used without performing the grouping.
In any of the above technical solutions, preferably, the determining unit is further configured to: and when the preset grouping quantity threshold is a second preset quantity threshold, determining the quantity of the grouping according to a second preset data type when the quantity of the evaluation items is detected to be larger than the second preset quantity threshold, wherein the second preset quantity threshold is 36, and the second preset data type is a double data type or an int data type.
In the technical scheme, the first preset number threshold is limited to 36, the data type is preset to be int type or short type, when the digit of the numerical string is greater than 36, the grouping number is determined according to the quotient between the digit and the storage digit corresponding to the int type data, and the corresponding grouping code (sequential identification from 0) is generated, so that when the digit of the numerical string is greater (greater than 36), the numerical string is grouped and stored, and the data type is reasonably determined, so that the optimized storage of the numerical string is further realized, and the storage space is effectively reduced.
In addition, if there are more than 36 items to be evaluated, the first two bits of the int type can be used to represent grouping to store scores of more evaluation items.
The int data type is 32 storage units, and the double data type is 64 storage units, i.e. 64 bits are used to store one data.
In any of the above technical solutions, preferably, the generating unit is further configured to: and generating a decimal numerical string according to the number of the plurality of evaluation items and the score value of each evaluation item.
According to the technical scheme, a decimal numerical string is directly generated according to the number of a plurality of evaluation items and the score value of each evaluation item, the score values are usually expressed in decimal numbers, the score values are directly generated into the numerical string according to a preset sequence, then whether the numerical string is split into the numerical strings or not is determined according to a preset grouping number threshold, then the corresponding data type is determined according to a preset threshold interval, and finally storage is achieved, and the processing process is simple.
In any of the above technical solutions, preferably, the determining unit is further configured to: determining a scale of the score value according to a maximum value among the score values of each of the evaluation items to generate the numerical string according to the scale, wherein the scale is octal or decimal when the maximum value is less than 8, decimal or hexadecimal when the maximum value is greater than or equal to 8 and less than 10, and hexadecimal when the maximum value is greater than or equal to 10 and less than or equal to 15.
In the technical scheme, the scale system mode of the score value is determined according to the maximum value of the score value of each evaluation item to determine the proper representation mode, and compared with the mode of only adopting decimal system, on one hand, the use range is wider, and on the other hand, the storage space can be further saved through the conversion of the numerical strings among different scale systems.
One byte is the space occupied by one English letter or Arabic number, and the representation of data in the computer exists in a binary form finally, namely the data stored in the computer is stored in the form of bytes, namely 8 binary codes, but not in the form of binary codes, so that the data can be regarded as being displayed to a processor (such as a processor) in the data processing process no matter whether the data is in the octal, decimal or hexadecimal form.
Specifically, when the plurality of scores are 10, 12, 15, 8, and 6, respectively, the string generated according to the decimal system is 10121586, and the corresponding hexadecimal values are a, C, F, 8, and 6, that is, the string generated according to the hexadecimal system is ACF86 (converted to the decimal number of 6+ 8+ 16+15 + 16+12 + 16+ 655360+49152+3840+128+ 708486), the storage space can be further saved during storage, but a conversion process is added.
An aspect of the fifth aspect of the present invention provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for storing user evaluation results proposed in the first aspect of the present invention when executing the computer program, or includes a storage device for user evaluation results proposed in the third aspect of the present invention.
In this technical solution, when the processor of the mobile terminal executes the computer program, the steps of the method for storing the user evaluation result proposed by the technical solution of the first aspect of the present invention are implemented or the storage device for storing the user evaluation result proposed by the technical solution of the third aspect of the present invention is included, so that all the advantages of the method for storing the user evaluation result proposed by the technical solution of the first aspect of the present invention or all the advantages of the storage device for the user evaluation result proposed by the technical solution of the third aspect of the present invention are achieved, and details are not repeated herein.
An aspect of the sixth aspect of the present invention provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for storing user evaluation results according to any one of the aspects of the present invention set forth in the second aspect of the present invention when executing the computer program, or includes a storage device for user evaluation results according to any one of the aspects of the present invention set forth in the fourth aspect of the present invention.
In this technical solution, when the processor of the server executes the computer program, the steps of the method for storing the user evaluation result proposed by the technical solution of the second aspect of the present invention are implemented or the storage device including the user evaluation result proposed by the technical solution of the fourth aspect of the present invention is included, so that all the advantages of the method for storing the user evaluation result proposed by the technical solution of the second aspect of the present invention or all the advantages of the storage device for the user evaluation result proposed by the technical solution of the fourth aspect of the present invention are achieved, and details are not described herein again.
An aspect of the seventh aspect of the present invention provides a computer-readable storage medium on which a computer program is stored, where the computer program, when executed by a processor, implements a method for storing a user evaluation result according to any one of the aspects set forth in the first aspect and/or the second aspect of the present invention.
In this technical solution, when being executed by a processor, a computer program stored on a computer-readable storage medium implements the method for storing the user evaluation result of any one of the first aspect and/or the second aspect of the present invention, so that all the beneficial effects of the method for storing the user evaluation result of any one of the first aspect and/or the second aspect of the present invention are achieved, and are not described herein again.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 shows a schematic flow diagram of a method of storing user rating results according to an embodiment of the invention;
FIG. 2 shows a schematic flow chart of a method of storing user rating results according to another embodiment of the present invention;
FIG. 3 shows a schematic block diagram of a storage means for user rating results according to an embodiment of the invention;
FIG. 4 shows a schematic block diagram of a storage means for user evaluation results according to another embodiment of the present invention;
FIG. 5 shows a schematic block diagram of a server according to one embodiment of the invention;
FIG. 6 shows a schematic block diagram of a mobile terminal according to one embodiment of the present invention;
fig. 7 is a schematic flow chart illustrating a method of storing user evaluation results according to still another embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited by the specific embodiments disclosed below.
Example 1
Fig. 1 shows a schematic flow chart of a method for storing user evaluation results according to an embodiment of the present invention.
As shown in fig. 1, a method for storing user evaluation results according to an embodiment of the present invention includes: step 102, obtaining the scoring values of a plurality of evaluation items; step 104, converting the plurality of scoring values into at least one numerical string to be stored; step 106, determining a preset threshold interval corresponding to each numerical string, so as to determine a corresponding data type according to the preset threshold interval; step 108, converting the numerical string to be stored into storage data according to the data type; and step 110, sending the storage data to a server so that the server stores a plurality of scores according to the storage byte number of the storage data.
In the technical scheme, after the score values of a user for a plurality of evaluation items are obtained, the plurality of score values are converted into one or more multi-bit data, namely a numerical string, and the relationship between the number of bits of the numerical string and a preset grouping number threshold is detected, so that when the number of bits of the numerical string is detected to be smaller than the preset grouping number threshold, a preset threshold interval corresponding to the numerical string is directly determined, and therefore a corresponding data type is determined according to the preset threshold interval, a storage identifier is stored according to the data type and is sent to a server for storage.
When the scoring values are all single digits, the digits of the numerical string are the same as the number of the evaluation items.
In addition, the score value may be a score of 1 to 100 points of the fine score, a score of 1 to 15 points of the coarser score, a score of 1 to 10 points of the coarser score, or a score of 1 to 5 points of the coarser score.
Specifically, the minimum unit of computer storage is byte at present, and each byte contains 8 bits (each bit can take a value of 0 or 1).
For the char type, the representation occupies one byte in the memory, i.e. 8 bits, which can represent 0-255 (or-128-127), and can store the scoring values of 2 items.
The short type representation occupies two bytes in the memory, namely 16 bits, and can represent 0-65535 (or-32768-32767), and the score values of 4 items can be stored at most.
int type, which represents that 4 bytes are occupied in the memory, namely 32 bits, 0-4294967295 (or-2147483648-2147483647), and can store the credit values of 9 items at most.
The double type represents that 8 bytes are occupied in the memory, and 64 bits are occupied.
For example, if there are 4 evaluation items with scores of 5, 5, 5, and 5, respectively, if the storage method in the prior art is used, since each number needs one byte, 4 bytes are needed, each byte stores one score, and by generating a numerical string, the 4 scores can be converted into decimal numbers (or octal numbers), i.e., 5555, where each digit of the decimal numbers represents one score, and since 5555 is smaller than 65535, the scores of the four evaluation items can be represented by using two bytes (short type), which saves half of the storage space compared with the conventional method. As above, four bytes (int type) maximally represents 10 digits, and then scores of 9 evaluation items (each score of the evaluation item is less than 10) can be stored at most, which saves 5 bytes compared with the conventional method.
In the above embodiment, preferably, the method further includes: converting the plurality of scoring values into at least one numerical string to be stored, specifically comprising the steps of: detecting whether the number of bits of the plurality of credit values is less than or equal to a preset packet number threshold value; when detecting that the number of bits of the plurality of scoring values is smaller than or equal to a preset grouping number threshold value, converting the plurality of scoring values into a numerical string; and when the digit of the plurality of scoring values is detected to be larger than a preset grouping quantity threshold value, grouping the evaluation items, and generating a plurality of data to be stored according to the corresponding data types after grouping, wherein the highest bit in each data to be stored represents a grouping serial number.
In this embodiment, when it is detected that the number of bits of the numerical string is greater than the preset grouping number threshold, the evaluation items are grouped to store the plurality of score values after grouping, and when the evaluation items are many, the generated numerical string does not fall within a value range specified by a preset data type (for example, a numerical range specified by a double type), so that the data cannot be stored by using the preset data type.
The grouped numerical value strings can be stored according to the same data type or different data types.
When the number of packets exceeds 10, the first two bits of the highest bit are used to represent the packet sequence number.
In any of the above embodiments, preferably, when it is detected that the number of bits of the plurality of score values is greater than a preset grouping number threshold, the evaluation items are grouped, so that after grouping, a plurality of data to be stored are generated according to corresponding data types, specifically including the following steps: and when the preset grouping quantity threshold is a first preset quantity threshold, determining the quantity of the grouping according to a first preset data type when the quantity of the evaluation items is detected to be larger than the first preset quantity threshold, wherein the first preset quantity threshold is 9, and the first preset data type is an int data type or a short data type.
In this embodiment, the first preset number threshold is limited to 9, the data type is preset to be int type or short type, when the number of bits of the numerical string is greater than 9, the number of packets is determined according to a quotient value between the number of bits and the storage number of bits corresponding to int type data, and corresponding packet codes (sequential identification from 0) are generated, so that when the number of bits of the numerical string is less than 36 bits, the numerical string is grouped and stored, and the data type is reasonably determined, so that the numerical string is optimally stored, and thus the storage space is effectively reduced.
The short data type is 16 storage units and the int data type is 32 storage units.
For example, when the evaluation values are all single-digit numbers, if the evaluation items exceed 9 items, for example, 15 items, after the evaluation items are grouped, 2 identifiers of 4 bytes (int type) may be used, or one int type and 2 short types, or 4 bytes of two bytes (short types), where the highest bits (e.g., 0, 1, 2, 3) of each number represent different evaluation item groups.
If it is an assessment with a score of no more than 9 points per assessment, then a maximum of 36 assessment items' scores can be stored using 4 int-types (the highest bits of each int-type number can be 0, 1, 2, 3, respectively, to represent different groupings).
In addition, the double type (8 bytes) representation may be used without performing the grouping.
In any of the above embodiments, preferably, when it is detected that the number of bits of the plurality of score values is greater than a preset grouping number threshold, the evaluation items are grouped, so that after grouping, a plurality of data to be stored are generated according to corresponding data types, specifically including the following steps: and when the preset grouping quantity threshold is a second preset quantity threshold, determining the quantity of the grouping according to a second preset data type when the quantity of the evaluation items is detected to be larger than the second preset quantity threshold, wherein the second preset quantity threshold is 36, and the second preset data type is a double data type or an int data type.
In this embodiment, the first preset number threshold is limited to 36, the data type is preset to be int type or short type, when the number of bits of the numeric string is greater than 36, the number of packets is determined according to a quotient value between the number of bits and the number of storage bits corresponding to int type data, and corresponding packet codes (sequential identification from 0) are generated, so that when the number of bits of the numeric string is large (greater than 36 bits), the numeric string is grouped and stored, and the data type is reasonably determined, so that the optimized storage of the numeric string is further realized, and thus the storage space is effectively reduced.
In addition, if there are more than 36 items to be evaluated, the first two bits of the int type can be used to represent grouping to store scores of more evaluation items.
The int data type is 32 storage units, and the double data type is 64 storage units, i.e. 64 bits are used to store one data.
In any of the above embodiments, preferably, the generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item specifically includes the following steps: and generating a decimal numerical string according to the number of the plurality of evaluation items and the score value of each evaluation item.
In the embodiment, a decimal numeric string is directly generated according to the number of a plurality of evaluation items and the score value of each evaluation item, because the score values are usually expressed by decimal numbers, the score values are directly generated into a numeric string according to a preset sequence, then whether the numeric string is split into a plurality of numeric strings is determined according to a preset grouping number threshold, and then the corresponding data type is determined according to a preset threshold interval, and finally, the storage is realized, and the processing process is simple.
In any of the above embodiments, preferably, the generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item specifically includes the following steps: determining a scale of the score value according to a maximum value among the score values of each of the evaluation items to generate the numerical string according to the scale, wherein the scale is octal or decimal when the maximum value is less than 8, decimal or hexadecimal when the maximum value is greater than or equal to 8 and less than 10, and hexadecimal when the maximum value is greater than or equal to 10 and less than or equal to 15.
In this embodiment, by determining the scale of the score value according to the maximum value of the score value of each evaluation item to determine the appropriate representation, the usage range is wider than that of the decimal system, and the storage space can be further saved by converting the value strings between different scales.
One byte is the space occupied by one English letter or Arabic number, and the representation of data in the computer exists in a binary form finally, namely the data stored in the computer is stored in the form of bytes, namely 8 binary codes, but not in the form of binary codes, so that the data can be regarded as being displayed to a processor (such as a processor) in the data processing process no matter whether the data is in the octal, decimal or hexadecimal form.
Specifically, when the plurality of scores are 10, 12, 15, 8, and 6, respectively, the string generated according to the decimal system is 10121586, and the corresponding hexadecimal values are a, C, F, 8, and 6, that is, the string generated according to the hexadecimal system is ACF86 (converted to the decimal number of 6+ 8+ 16+15 + 16+12 + 16+ 655360+49152+3840+128+ 708486), the storage space can be further saved during storage, but a conversion process is added.
Example 2
Fig. 2 is a schematic flow chart illustrating a method of storing user evaluation results according to another embodiment of the present invention.
As shown in fig. 2, a method for storing user evaluation results according to another embodiment of the present invention includes: step 202, receiving the scoring values aiming at a plurality of evaluation items sent by the online car booking client; step 204, converting the plurality of scoring values into at least one numerical string to be stored; step 206, determining a preset threshold interval corresponding to each numerical string, so as to determine a corresponding data type according to the preset threshold interval; and step 208, storing the numerical value string to be stored according to the data type.
In this embodiment, by receiving the score values for the plurality of evaluation items transmitted from the terminal, converting the plurality of score values into one or more multi-bit data, i.e. a numerical string, and detecting the relationship between the number of bits of the numerical string and a preset packet number threshold, to directly determine a preset threshold interval corresponding to the numerical string when the number of bits of the numerical string is detected to be less than the preset packet number threshold, thereby determining the corresponding data type according to the preset threshold interval, carrying out storage identification according to the data type, sending the data type to a server for storage, compared with the prior art of recording one credit value by one byte, the method helps to reduce the storage space, therefore, the storage pressure of the server side is reduced, and compared with the embodiment of the first aspect of the invention, the data processing and conversion process is completed at the server side, so that the processing pressure of the mobile terminal can be reduced.
When the scoring values are all single digits, the digits of the numerical string are the same as the number of the evaluation items.
In addition, the score value may be a score of 1 to 100 points of the fine score, a score of 1 to 15 points of the coarser score, a score of 1 to 10 points of the coarser score, or a score of 1 to 5 points of the coarser score.
Specifically, the minimum unit of computer storage is byte at present, and each byte contains 8 bits (each bit can take a value of 0 or 1).
For the char type, the representation occupies one byte in the memory, i.e. 8 bits, which can represent 0-255 (or-128-127), and can store the scoring values of 2 items.
The short type representation occupies two bytes in the memory, namely 16 bits, and can represent 0-65535 (or-32768-32767), and the score values of 4 items can be stored at most.
int type, which represents that 4 bytes are occupied in the memory, namely 32 bits, 0-4294967295 (or-2147483648-2147483647), and can store the credit values of 9 items at most.
The double type represents that 8 bytes are occupied in the memory, and 64 bits are occupied.
In the above embodiment, preferably, the converting the plurality of score values into at least one numerical string to be stored specifically includes the following steps: detecting whether the number of bits of the plurality of credit values is less than or equal to a preset packet number threshold value; when detecting that the number of bits of the plurality of scoring values is smaller than or equal to a preset grouping number threshold value, converting the plurality of scoring values into a numerical string; and when the digit of the plurality of scoring values is detected to be larger than a preset grouping quantity threshold value, grouping the evaluation items, and generating a plurality of data to be stored according to the corresponding data types after grouping, wherein the highest bit in each data to be stored represents a grouping serial number.
In this embodiment, when it is detected that the number of bits of the numerical string is greater than the preset grouping number threshold, the evaluation items are grouped to store the plurality of score values after grouping, and when the evaluation items are many, the generated numerical string does not fall within a value range specified by a preset data type (for example, a numerical range specified by a double type), so that the data cannot be stored by using the preset data type.
The grouped numerical value strings can be stored according to the same data type or different data types.
When the number of packets exceeds 10, the first two bits of the highest bit are used to represent the packet sequence number.
In any of the above embodiments, preferably, when it is detected that the number of bits of the plurality of score values is greater than a preset grouping number threshold, the evaluation items are grouped, so that after grouping, a plurality of data to be stored are generated according to corresponding data types, specifically including the following steps: and when the preset grouping quantity threshold is a first preset quantity threshold, determining the quantity of the grouping according to a first preset data type when the quantity of the evaluation items is detected to be larger than the first preset quantity threshold, wherein the first preset quantity threshold is 9, and the first preset data type is an int data type or a short data type.
In this embodiment, the first preset number threshold is limited to 9, the data type is preset to be int type or short type, when the number of bits of the numerical string is greater than 9, the number of packets is determined according to a quotient value between the number of bits and the storage number of bits corresponding to int type data, and corresponding packet codes (sequential identification from 0) are generated, so that when the number of bits of the numerical string is less than 36 bits, the numerical string is grouped and stored, and the data type is reasonably determined, so that the numerical string is optimally stored, and thus the storage space is effectively reduced.
The short data type is 16 storage units and the int data type is 32 storage units.
For example, when the evaluation values are all single-digit numbers, if the evaluation items exceed 9 items, for example, 15 items, after the evaluation items are grouped, 2 identifiers of 4 bytes (int type) may be used, or one int type and 2 short types, or 4 bytes of two bytes (short types), where the highest bits (e.g., 0, 1, 2, 3) of each number represent different evaluation item groups.
If it is an assessment with a score of no more than 9 points per assessment, then a maximum of 36 assessment items' scores can be stored using 4 int-types (the highest bits of each int-type number can be 0, 1, 2, 3, respectively, to represent different groupings).
In addition, the double type (8 bytes) representation may be used without performing the grouping.
In any of the above embodiments, preferably, when it is detected that the number of bits of the plurality of score values is greater than a preset grouping number threshold, the evaluation items are grouped, so that after grouping, a plurality of data to be stored are generated according to corresponding data types, specifically including the following steps: and when the preset grouping quantity threshold is a second preset quantity threshold, determining the quantity of the grouping according to a second preset data type when the quantity of the evaluation items is detected to be larger than the second preset quantity threshold, wherein the second preset quantity threshold is 36, and the second preset data type is a double data type or an int data type.
In this embodiment, the first preset number threshold is limited to 36, the data type is preset to be int type or short type, when the number of bits of the numeric string is greater than 36, the number of packets is determined according to a quotient value between the number of bits and the number of storage bits corresponding to int type data, and corresponding packet codes (sequential identification from 0) are generated, so that when the number of bits of the numeric string is large (greater than 36 bits), the numeric string is grouped and stored, and the data type is reasonably determined, so that the optimized storage of the numeric string is further realized, and thus the storage space is effectively reduced.
In addition, if there are more than 36 items to be evaluated, the first two bits of the int type can be used to represent grouping to store scores of more evaluation items.
The int data type is 32 storage units, and the double data type is 64 storage units, i.e. 64 bits are used to store one data.
In any of the above embodiments, preferably, the generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item specifically includes the following steps: and generating a decimal numerical string according to the number of the plurality of evaluation items and the score value of each evaluation item.
In the embodiment, a decimal numeric string is directly generated according to the number of a plurality of evaluation items and the score value of each evaluation item, because the score values are usually expressed by decimal numbers, the score values are directly generated into a numeric string according to a preset sequence, then whether the numeric string is split into a plurality of numeric strings is determined according to a preset grouping number threshold, and then the corresponding data type is determined according to a preset threshold interval, and finally, the storage is realized, and the processing process is simple.
In any of the above embodiments, preferably, the generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item specifically includes the following steps: determining a scale of the score value according to a maximum value among the score values of each of the evaluation items to generate the numerical string according to the scale, wherein the scale is octal or decimal when the maximum value is less than 8, decimal or hexadecimal when the maximum value is greater than or equal to 8 and less than 10, and hexadecimal when the maximum value is greater than or equal to 10 and less than or equal to 15.
In this embodiment, by determining the scale of the score value according to the maximum value of the score value of each evaluation item to determine the appropriate representation, the usage range is wider than that of the decimal system, and the storage space can be further saved by converting the value strings between different scales.
One byte is the space occupied by one English letter or Arabic number, and the representation of data in the computer exists in a binary form finally, namely the data stored in the computer is stored in the form of bytes, namely 8 binary codes, but not in the form of binary codes, so that the data can be regarded as being displayed to a processor (such as a processor) in the data processing process no matter whether the data is in the octal, decimal or hexadecimal form.
Specifically, when the plurality of scores are 10, 12, 15, 8, and 6, respectively, the string generated according to the decimal system is 10121586, and the corresponding hexadecimal values are a, C, F, 8, and 6, that is, the string generated according to the hexadecimal system is ACF86 (converted to the decimal number of 6+ 8+ 16+15 + 16+12 + 16+ 655360+49152+3840+128+ 708486), the storage space can be further saved during storage, but a conversion process is added.
Example 3
Fig. 3 shows a schematic block diagram of a storage means 30 for user evaluation results according to an embodiment of the present invention.
As shown in fig. 3, the storage device 30 for user evaluation results according to an embodiment of the present invention includes: an acquisition unit 302 for acquiring score values for a plurality of evaluation items; a conversion unit 304, configured to convert the plurality of score values into at least one numerical string to be stored; a determining unit 306, configured to determine a preset threshold interval corresponding to each numerical string, so as to determine a corresponding data type according to the preset threshold interval; the conversion unit 304 is further configured to: converting the numerical string to be stored into storage data according to the data type; a sending unit 308, configured to send the stored data to the server, so that the server stores a plurality of scores according to the number of bytes of the stored data.
In the embodiment, after the score values of a user for a plurality of evaluation items are obtained, the plurality of score values are converted into a multi-bit data, namely a numerical string, and the relationship between the number of bits of the numerical string and a preset grouping number threshold is detected, so that when the number of bits of the numerical string is detected to be smaller than the preset grouping number threshold, a preset threshold interval corresponding to the numerical string is directly determined, and therefore, a corresponding data type is determined according to the preset threshold interval, a storage identifier is stored according to the data type and is sent to a server for storage.
When the scoring values are all single digits, the digits of the numerical string are the same as the number of the evaluation items.
In addition, the score value may be a score of 1 to 100 points of the fine score, a score of 1 to 15 points of the coarser score, a score of 1 to 10 points of the coarser score, or a score of 1 to 5 points of the coarser score.
Specifically, the minimum unit of computer storage is byte at present, and each byte contains 8 bits (each bit can take a value of 0 or 1).
For the char type, the representation occupies one byte in the memory, i.e. 8 bits, which can represent 0-255 (or-128-127), and can store the scoring values of 2 items.
The short type representation occupies two bytes in the memory, namely 16 bits, and can represent 0-65535 (or-32768-32767), and the score values of 4 items can be stored at most.
int type, which represents that 4 bytes are occupied in the memory, namely 32 bits, 0-4294967295 (or-2147483648-2147483647), and can store the credit values of 9 items at most.
The double type represents that 8 bytes are occupied in the memory, and 64 bits are occupied.
For example, if there are 4 evaluation items with scores of 5, 5, 5, and 5, respectively, if the storage method in the prior art is used, since each number needs one byte, 4 bytes are needed, each byte stores one score, and by generating a numerical string, the 4 scores can be converted into decimal numbers (or octal numbers), i.e., 5555, where each digit of the decimal numbers represents one score, and since 5555 is smaller than 65535, the scores of the four evaluation items can be represented by using two bytes (short type), which saves half of the storage space compared with the conventional method. As above, four bytes (int type) maximally represents 10 digits, and then scores of 9 evaluation items (each score of the evaluation item is less than 10) can be stored at most, which saves 5 bytes compared with the conventional method.
In the above embodiment, preferably, the method further includes: a detecting unit 310, configured to detect whether a number of bits of the plurality of score values is less than or equal to a preset packet number threshold; the conversion unit 304 is further configured to: when detecting that the number of bits of the plurality of scoring values is smaller than or equal to a preset grouping number threshold value, converting the plurality of scoring values into a numerical string; the storage device 30 further includes: the grouping unit 312 is configured to, when it is detected that the number of bits of the multiple score values is greater than a preset grouping number threshold, group the evaluation items, so as to generate multiple data to be stored according to corresponding data types after grouping, where a highest order in each data to be stored represents a grouping number.
In this embodiment, when it is detected that the number of bits of the numerical string is greater than the preset grouping number threshold, the evaluation items are grouped to store the plurality of score values after grouping, and when the evaluation items are many, the generated numerical string does not fall within a value range specified by a preset data type (for example, a numerical range specified by a double type), so that the data cannot be stored by using the preset data type.
The grouped numerical value strings can be stored according to the same data type or different data types.
When the number of packets exceeds 10, the first two bits of the highest bit are used to represent the packet sequence number.
In any of the above embodiments, preferably, the determining unit 306 is further configured to: and when the preset grouping quantity threshold is a first preset quantity threshold, determining the quantity of the grouping according to a first preset data type when the quantity of the evaluation items is detected to be larger than the first preset quantity threshold, wherein the first preset quantity threshold is 9, and the first preset data type is an int data type or a short data type.
In this embodiment, the first preset number threshold is limited to 9, the data type is preset to be int type or short type, when the number of bits of the numerical string is greater than 9, the number of packets is determined according to a quotient value between the number of bits and the storage number of bits corresponding to int type data, and corresponding packet codes (sequential identification from 0) are generated, so that when the number of bits of the numerical string is less than 36 bits, the numerical string is grouped and stored, and the data type is reasonably determined, so that the numerical string is optimally stored, and thus the storage space is effectively reduced.
The short data type is 16 storage units and the int data type is 32 storage units.
For example, when the evaluation values are all single-digit numbers, if the evaluation items exceed 9 items, for example, 15 items, after the evaluation items are grouped, 2 identifiers of 4 bytes (int type) may be used, or one int type and 2 short types, or 4 bytes of two bytes (short types), where the highest bits (e.g., 0, 1, 2, 3) of each number represent different evaluation item groups.
If it is an assessment with a score of no more than 9 points per assessment, then a maximum of 36 assessment items' scores can be stored using 4 int-types (the highest bits of each int-type number can be 0, 1, 2, 3, respectively, to represent different groupings).
In addition, the double type (8 bytes) representation may be used without performing the grouping.
In any of the above embodiments, preferably, the determining unit 306 is further configured to: and when the preset grouping quantity threshold is a second preset quantity threshold, determining the quantity of the grouping according to a second preset data type when the quantity of the evaluation items is detected to be larger than the second preset quantity threshold, wherein the second preset quantity threshold is 36, and the second preset data type is a double data type or an int data type.
In this embodiment, the first preset number threshold is limited to 36, the data type is preset to be int type or short type, when the number of bits of the numeric string is greater than 36, the number of packets is determined according to a quotient value between the number of bits and the number of storage bits corresponding to int type data, and corresponding packet codes (sequential identification from 0) are generated, so that when the number of bits of the numeric string is large (greater than 36 bits), the numeric string is grouped and stored, and the data type is reasonably determined, so that the optimized storage of the numeric string is further realized, and thus the storage space is effectively reduced.
In addition, if there are more than 36 items to be evaluated, the first two bits of the int type can be used to represent grouping to store scores of more evaluation items.
The int data type is 32 storage units, and the double data type is 64 storage units, i.e. 64 bits are used to store one data.
In any of the above embodiments, preferably, the method further includes: a generating unit 314 for generating a decimal numeric string according to the number of the plurality of evaluation items and the score value of each evaluation item.
In the embodiment, a decimal numeric string is directly generated according to the number of a plurality of evaluation items and the score value of each evaluation item, because the score values are usually expressed by decimal numbers, the score values are directly generated into a numeric string according to a preset sequence, then whether the numeric string is split into a plurality of numeric strings is determined according to a preset grouping number threshold, and then the corresponding data type is determined according to a preset threshold interval, and finally, the storage is realized, and the processing process is simple.
In any of the above embodiments, preferably, the determining unit 306 is further configured to: determining a scale of the score value according to a maximum value among the score values of each of the evaluation items to generate the numerical string according to the scale, wherein the scale is octal or decimal when the maximum value is less than 8, decimal or hexadecimal when the maximum value is greater than or equal to 8 and less than 10, and hexadecimal when the maximum value is greater than or equal to 10 and less than or equal to 15.
In this embodiment, by determining the scale of the score value according to the maximum value of the score value of each evaluation item to determine the appropriate representation, the usage range is wider than that of the decimal system, and the storage space can be further saved by converting the value strings between different scales.
One byte is the space occupied by one English letter or Arabic number, and the representation of data in the computer exists in a binary form finally, namely the data stored in the computer is stored in the form of bytes, namely 8 binary codes, but not in the form of binary codes, so that the data can be regarded as being displayed to a processor (such as a processor) in the data processing process no matter whether the data is in the octal, decimal or hexadecimal form.
Specifically, when the plurality of scores are 10, 12, 15, 8, and 6, respectively, the string generated according to the decimal system is 10121586, and the corresponding hexadecimal values are a, C, F, 8, and 6, that is, the string generated according to the hexadecimal system is ACF86 (converted to the decimal number of 6+ 8+ 16+15 + 16+12 + 16+ 655360+49152+3840+128+ 708486), the storage space can be further saved during storage, but a conversion process is added.
Example 4
Fig. 4 shows a schematic block diagram of a storage means 40 of user evaluation results according to another embodiment of the present invention.
As shown in fig. 4, the storage device 40 for user evaluation results according to another embodiment of the present invention includes: a receiving unit 402, configured to receive score values for a plurality of evaluation items sent by a network appointment client; a conversion unit 404, configured to convert the plurality of scoring values into at least one numerical string to be stored; a determining unit 406, configured to determine a preset threshold interval corresponding to each numerical string, so as to determine a corresponding data type according to the preset threshold interval; the storage unit 408 is configured to store the numerical string to be stored according to the data type.
In this embodiment, by receiving the score values for the plurality of evaluation items transmitted from the terminal, converting the plurality of score values into one or more multi-bit data, i.e. a numerical string, and detecting the relationship between the number of bits of the numerical string and a preset packet number threshold, to directly determine a preset threshold interval corresponding to the numerical string when the number of bits of the numerical string is detected to be less than the preset packet number threshold, thereby determining the corresponding data type according to the preset threshold interval, carrying out storage identification according to the data type, sending the data type to a server for storage, compared with the prior art of recording one credit value by one byte, the method helps to reduce the storage space, therefore, the storage pressure of the server side is reduced, and compared with the embodiment of the first aspect of the invention, the data processing and conversion process is completed at the server side, so that the processing pressure of the mobile terminal can be reduced.
When the scoring values are all single digits, the digits of the numerical string are the same as the number of the evaluation items.
In addition, the score value may be a score of 1 to 100 points of the fine score, a score of 1 to 15 points of the coarser score, a score of 1 to 10 points of the coarser score, or a score of 1 to 5 points of the coarser score.
Specifically, the minimum unit of computer storage is byte at present, and each byte contains 8 bits (each bit can take a value of 0 or 1).
For the char type, the representation occupies one byte in the memory, i.e. 8 bits, which can represent 0-255 (or-128-127), and can store the scoring values of 2 items.
The short type representation occupies two bytes in the memory, namely 16 bits, and can represent 0-65535 (or-32768-32767), and the score values of 4 items can be stored at most.
int type, which represents that 4 bytes are occupied in the memory, namely 32 bits, 0-4294967295 (or-2147483648-2147483647), and can store the credit values of 9 items at most.
The double type represents that 8 bytes are occupied in the memory, and 64 bits are occupied.
In the above embodiment, preferably, the method further includes: a detecting unit 410, configured to detect whether a number of bits of the plurality of score values is less than or equal to a preset packet number threshold; the conversion unit 404 is further configured to: when detecting that the number of bits of the plurality of scoring values is smaller than or equal to a preset grouping number threshold value, converting the plurality of scoring values into a numerical string; the storage device 40 further includes: the grouping unit 412 is configured to, when it is detected that the number of bits of the multiple score values is greater than a preset grouping number threshold, group the evaluation items, so as to generate multiple data to be stored according to corresponding data types after grouping, where a highest order in each data to be stored represents a grouping number.
In this embodiment, when it is detected that the number of bits of the numerical string is greater than the preset grouping number threshold, the evaluation items are grouped to store the plurality of score values after grouping, and when the evaluation items are many, the generated numerical string does not fall within a value range specified by a preset data type (for example, a numerical range specified by a double type), so that the data cannot be stored by using the preset data type.
The grouped numerical value strings can be stored according to the same data type or different data types.
When the number of packets exceeds 10, the first two bits of the highest bit are used to represent the packet sequence number.
In any of the above embodiments, preferably, the determining unit 406 is further configured to: and when the preset grouping quantity threshold is a first preset quantity threshold, determining the quantity of the grouping according to a first preset data type when the quantity of the evaluation items is detected to be larger than the first preset quantity threshold, wherein the first preset quantity threshold is 9, and the first preset data type is an int data type or a short data type.
In this embodiment, the first preset number threshold is limited to 9, the data type is preset to be int type or short type, when the number of bits of the numerical string is greater than 9, the number of packets is determined according to a quotient value between the number of bits and the storage number of bits corresponding to int type data, and corresponding packet codes (sequential identification from 0) are generated, so that when the number of bits of the numerical string is less than 36 bits, the numerical string is grouped and stored, and the data type is reasonably determined, so that the numerical string is optimally stored, and thus the storage space is effectively reduced.
The short data type is 16 storage units and the int data type is 32 storage units.
For example, when the evaluation values are all single-digit numbers, if the evaluation items exceed 9 items, for example, 15 items, after the evaluation items are grouped, 2 identifiers of 4 bytes (int type) may be used, or one int type and 2 short types, or 4 bytes of two bytes (short types), where the highest bits (e.g., 0, 1, 2, 3) of each number represent different evaluation item groups.
If it is an assessment with a score of no more than 9 points per assessment, then a maximum of 36 assessment items' scores can be stored using 4 int-types (the highest bits of each int-type number can be 0, 1, 2, 3, respectively, to represent different groupings).
In addition, the double type (8 bytes) representation may be used without performing the grouping.
In any of the above embodiments, preferably, the determining unit 406 is further configured to: and when the preset grouping quantity threshold is a second preset quantity threshold, determining the quantity of the grouping according to a second preset data type when the quantity of the evaluation items is detected to be larger than the second preset quantity threshold, wherein the second preset quantity threshold is 36, and the second preset data type is a double data type or an int data type.
In this embodiment, the first preset number threshold is limited to 36, the data type is preset to be int type or short type, when the number of bits of the numeric string is greater than 36, the number of packets is determined according to a quotient value between the number of bits and the number of storage bits corresponding to int type data, and corresponding packet codes (sequential identification from 0) are generated, so that when the number of bits of the numeric string is large (greater than 36 bits), the numeric string is grouped and stored, and the data type is reasonably determined, so that the optimized storage of the numeric string is further realized, and thus the storage space is effectively reduced.
In addition, if there are more than 36 items to be evaluated, the first two bits of the int type can be used to represent grouping to store scores of more evaluation items.
The int data type is 32 storage units, and the double data type is 64 storage units, i.e. 64 bits are used to store one data.
In any of the above embodiments, preferably, the method further includes: a generating unit 414 for generating a decimal numeric string according to the number of the plurality of evaluation items and the score value of each evaluation item.
In the embodiment, a decimal numeric string is directly generated according to the number of a plurality of evaluation items and the score value of each evaluation item, because the score values are usually expressed by decimal numbers, the score values are directly generated into a numeric string according to a preset sequence, then whether the numeric string is split into a plurality of numeric strings is determined according to a preset grouping number threshold, and then the corresponding data type is determined according to a preset threshold interval, and finally, the storage is realized, and the processing process is simple.
In any of the above embodiments, preferably, the determining unit 408 is further configured to: determining a scale of the score value according to a maximum value among the score values of each of the evaluation items to generate the numerical string according to the scale, wherein the scale is octal or decimal when the maximum value is less than 8, decimal or hexadecimal when the maximum value is greater than or equal to 8 and less than 10, and hexadecimal when the maximum value is greater than or equal to 10 and less than or equal to 15.
In this embodiment, by determining the scale of the score value according to the maximum value of the score value of each evaluation item to determine the appropriate representation, the usage range is wider than that of the decimal system, and the storage space can be further saved by converting the value strings between different scales.
One byte is the space occupied by one English letter or Arabic number, and the representation of data in the computer exists in a binary form finally, namely the data stored in the computer is stored in the form of bytes, namely 8 binary codes, but not in the form of binary codes, so that the data can be regarded as being displayed to a processor (such as a processor) in the data processing process no matter whether the data is in the octal, decimal or hexadecimal form.
Specifically, when the plurality of scores are 10, 12, 15, 8, and 6, respectively, the string generated according to the decimal system is 10121586, and the corresponding hexadecimal values are a, C, F, 8, and 6, that is, the string generated according to the hexadecimal system is ACF86 (converted to the decimal number of 6+ 8+ 16+15 + 16+12 + 16+ 655360+49152+3840+128+ 708486), the storage space can be further saved during storage, but a conversion process is added.
Example 5
Fig. 5 shows a schematic block diagram of a server 50 according to an embodiment of the invention.
As shown in fig. 5, a server 50 according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the method for storing user evaluation results according to embodiment 1 of the present invention, or to include the storage device 30 for user evaluation results according to embodiment 3 of the present invention.
In this embodiment, when the processor of the server 50 executes the computer program, the steps of the method for storing the user evaluation result proposed by embodiment 1 of the present invention or the storage device 30 including the user evaluation result proposed by embodiment 3 of the present invention are implemented, so that all the advantages of the method for storing the user evaluation result proposed by embodiment 1 of the present invention or all the advantages of the storage device 30 including the user evaluation result proposed by embodiment 3 of the present invention are achieved, and no further description is provided herein.
Example 6
As shown in fig. 6, the mobile terminal 60 according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the method for storing the user evaluation result according to any one of embodiment 2 of the present invention, or to include the storage device 40 for the user evaluation result according to any one of embodiment 4 of the present invention.
In this embodiment, when the processor of the mobile terminal 60 executes the computer program, the steps of the method for storing the user evaluation result proposed by any one of embodiment 2 of the present invention or the storage device 40 including the user evaluation result proposed by any one of embodiment 4 of the present invention are implemented, so that all the advantages of the method for storing the user evaluation result proposed by any one of embodiment 2 of the present invention or all the advantages of the storage device 40 including the user evaluation result proposed by any one of embodiment 4 of the present invention are achieved, and details are not repeated herein.
Example 7
A computer-readable storage medium according to an embodiment of the invention, on which a computer program is stored which, when executed by a processor, performs the steps of: generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item; detecting whether the number of bits of the numerical string is less than or equal to a preset grouping number threshold value; when the digit of the numerical string is detected to be less than or equal to the threshold value of the number of the preset groups, determining a preset threshold value interval corresponding to the numerical string so as to determine a corresponding data type according to the preset threshold value interval; converting the numerical string to be stored into storage data according to the data type; and sending the stored data to a server so that the server stores a plurality of scores according to the number of bytes of the stored data.
In the embodiment, after the score values of a user for a plurality of evaluation items are obtained, the plurality of score values are converted into a multi-bit data, namely a numerical string, and the relationship between the number of bits of the numerical string and a preset grouping number threshold is detected, so that when the number of bits of the numerical string is detected to be smaller than the preset grouping number threshold, a preset threshold interval corresponding to the numerical string is directly determined, and therefore, a corresponding data type is determined according to the preset threshold interval, a storage identifier is stored according to the data type and is sent to a server for storage.
When the scoring values are all single digits, the digits of the numerical string are the same as the number of the evaluation items.
In addition, the score value may be a score of 1 to 100 points of the fine score, a score of 1 to 15 points of the coarser score, a score of 1 to 10 points of the coarser score, or a score of 1 to 5 points of the coarser score.
Specifically, the minimum unit of computer storage is byte at present, and each byte contains 8 bits (each bit can take a value of 0 or 1).
For the char type, the representation occupies one byte in the memory, i.e. 8 bits, which can represent 0-255 (or-128-127), and can store the scoring values of 2 items.
The short type representation occupies two bytes in the memory, namely 16 bits, and can represent 0-65535 (or-32768-32767), and the score values of 4 items can be stored at most.
int type, which represents that 4 bytes are occupied in the memory, namely 32 bits, 0-4294967295 (or-2147483648-2147483647), and can store the credit values of 9 items at most.
The double type represents that 8 bytes are occupied in the memory, and 64 bits are occupied.
For example, if there are 4 evaluation items with scores of 5, 5, 5, and 5, respectively, if the storage method in the prior art is used, since each number needs one byte, 4 bytes are needed, each byte stores one score, and by generating a numerical string, the 4 scores can be converted into decimal numbers (or octal numbers), i.e., 5555, where each digit of the decimal numbers represents one score, and since 5555 is smaller than 65535, the scores of the four evaluation items can be represented by using two bytes (short type), which saves half of the storage space compared with the conventional method. As above, four bytes (int type) maximally represents 10 digits, and then scores of 9 evaluation items (each score of the evaluation item is less than 10) can be stored at most, which saves 5 bytes compared with the conventional method.
And/or: receiving the scoring values aiming at the plurality of evaluation items sent by the online taxi appointment client; generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item; detecting whether the number of bits of the numerical string is less than or equal to a preset grouping number threshold value; when the digit of the numerical string is detected to be less than or equal to the threshold value of the number of the preset groups, determining a preset threshold value interval corresponding to the numerical string so as to determine a corresponding data type according to the preset threshold value interval; and storing the numerical value string to be stored according to the data type.
In this embodiment, by receiving the score values for a plurality of evaluation items transmitted from the terminal, converting the plurality of score values into one multi-bit data, i.e. a numerical string, and detecting the relationship between the number of bits of the numerical string and a preset packet number threshold, to directly determine a preset threshold interval corresponding to the numerical string when the number of bits of the numerical string is detected to be less than the preset packet number threshold, thereby determining the corresponding data type according to the preset threshold interval, carrying out storage identification according to the data type, sending the data type to a server for storage, compared with the prior art of recording one credit value by one byte, the method helps to reduce the storage space, therefore, the storage pressure of the server side is reduced, and compared with the embodiment of the first aspect of the invention, the data processing and conversion process is completed at the server side, so that the processing pressure of the mobile terminal can be reduced.
When the scoring values are all single digits, the digits of the numerical string are the same as the number of the evaluation items.
In addition, the score value may be a score of 1 to 100 points of the fine score, a score of 1 to 15 points of the coarser score, a score of 1 to 10 points of the coarser score, or a score of 1 to 5 points of the coarser score.
Specifically, the minimum unit of computer storage is byte at present, and each byte contains 8 bits (each bit can take a value of 0 or 1).
For the char type, the representation occupies one byte in the memory, i.e. 8 bits, which can represent 0-255 (or-128-127), and can store the scoring values of 2 items.
The short type representation occupies two bytes in the memory, namely 16 bits, and can represent 0-65535 (or-32768-32767), and the score values of 4 items can be stored at most.
int type, which represents that 4 bytes are occupied in the memory, namely 32 bits, 0-4294967295 (or-2147483648-2147483647), and can store the credit values of 9 items at most. The double type represents that 8 bytes are occupied in the memory, and 64 bits are occupied.
In the above embodiment, preferably, the method further includes: and when the digit of the numerical string is detected to be larger than a preset grouping quantity threshold value, grouping the evaluation items, and generating a plurality of data to be stored according to the corresponding data types after grouping, wherein the highest digit in each data to be stored represents a grouping serial number.
In this embodiment, when it is detected that the number of bits of the numerical string is greater than the preset grouping number threshold, the evaluation items are grouped to store the plurality of score values after grouping, and when the evaluation items are many, the generated numerical string does not fall within a value range specified by a preset data type (for example, a numerical range specified by a double type), so that the data cannot be stored by using the preset data type.
The grouped numerical value strings can be stored according to the same data type or different data types.
When the number of packets exceeds 10, the first two bits of the highest bit are used to represent the packet sequence number.
In any of the above embodiments, preferably, when the number of bits of the numerical string and the preset grouping number threshold are detected, the evaluation items are grouped, so that after grouping, a plurality of data to be stored are generated according to the corresponding data type, specifically including the following steps: and when the preset grouping quantity threshold is a first preset quantity threshold, determining the quantity of the grouping according to a first preset data type when the quantity of the evaluation items is detected to be larger than the first preset quantity threshold, wherein the first preset quantity threshold is 9, and the first preset data type is an int data type or a short data type.
In this embodiment, the first preset number threshold is limited to 9, the data type is preset to be int type or short type, when the number of bits of the numerical string is greater than 9, the number of packets is determined according to a quotient value between the number of bits and the storage number of bits corresponding to int type data, and corresponding packet codes (sequential identification from 0) are generated, so that when the number of bits of the numerical string is less than 36 bits, the numerical string is grouped and stored, and the data type is reasonably determined, so that the numerical string is optimally stored, and thus the storage space is effectively reduced.
The short data type is 16 storage units and the int data type is 32 storage units.
For example, when the evaluation values are all single-digit numbers, if the evaluation items exceed 9 items, for example, 15 items, after the evaluation items are grouped, 2 identifiers of 4 bytes (int type) may be used, or one int type and 2 short types, or 4 bytes of two bytes (short types), where the highest bits (e.g., 0, 1, 2, 3) of each number represent different evaluation item groups.
If it is an assessment with a score of no more than 9 points per assessment, then a maximum of 36 assessment items' scores can be stored using 4 int-types (the highest bits of each int-type number can be 0, 1, 2, 3, respectively, to represent different groupings).
In addition, the double type (8 bytes) representation may be used without performing the grouping.
In any of the above embodiments, preferably, when it is detected that the number of bits of the numerical string is greater than the preset grouping number threshold, the evaluation items are grouped, so that after grouping, a plurality of data to be stored are generated according to the corresponding data type, specifically including the following steps: and when the preset grouping quantity threshold is a second preset quantity threshold, determining the quantity of the grouping according to a second preset data type when the quantity of the evaluation items is detected to be larger than the second preset quantity threshold, wherein the second preset quantity threshold is 36, and the second preset data type is a double data type or an int data type.
In this embodiment, the first preset number threshold is limited to 36, the data type is preset to be int type or short type, when the number of bits of the numeric string is greater than 36, the number of packets is determined according to a quotient value between the number of bits and the number of storage bits corresponding to int type data, and corresponding packet codes (sequential identification from 0) are generated, so that when the number of bits of the numeric string is large (greater than 36 bits), the numeric string is grouped and stored, and the data type is reasonably determined, so that the optimized storage of the numeric string is further realized, and thus the storage space is effectively reduced.
In addition, if there are more than 36 items to be evaluated, the first two bits of the int type can be used to represent grouping to store scores of more evaluation items.
The int data type is 32 storage units, and the double data type is 64 storage units, i.e. 64 bits are used to store one data.
In any of the above embodiments, preferably, the generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item specifically includes the following steps: and generating a decimal numerical string according to the number of the plurality of evaluation items and the score value of each evaluation item.
In the embodiment, a decimal numeric string is directly generated according to the number of a plurality of evaluation items and the score value of each evaluation item, because the score values are usually expressed by decimal numbers, the score values are directly generated into a numeric string according to a preset sequence, then whether the numeric string is split into a plurality of numeric strings is determined according to a preset grouping number threshold, and then the corresponding data type is determined according to a preset threshold interval, and finally, the storage is realized, and the processing process is simple.
In any of the above embodiments, preferably, the generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item specifically includes the following steps: determining a scale of the score value according to a maximum value among the score values of each of the evaluation items to generate the numerical string according to the scale, wherein the scale is octal or decimal when the maximum value is less than 8, decimal or hexadecimal when the maximum value is greater than or equal to 8 and less than 10, and hexadecimal when the maximum value is greater than or equal to 10 and less than or equal to 15.
In this embodiment, by determining the scale of the score value according to the maximum value of the score value of each evaluation item to determine the appropriate representation, the usage range is wider than that of the decimal system, and the storage space can be further saved by converting the value strings between different scales.
One byte is the space occupied by one English letter or Arabic number, and the representation of data in the computer exists in a binary form finally, namely the data stored in the computer is stored in the form of bytes, namely 8 binary codes, but not in the form of binary codes, so that the data can be regarded as being displayed to a processor (such as a processor) in the data processing process no matter whether the data is in the octal, decimal or hexadecimal form.
Specifically, when the plurality of scores are 10, 12, 15, 8, and 6, respectively, the string generated according to the decimal system is 10121586, and the corresponding hexadecimal values are a, C, F, 8, and 6, that is, the string generated according to the hexadecimal system is ACF86 (converted to the decimal number of 6+ 8+ 16+15 + 16+12 + 16+ 655360+49152+3840+128+ 708486), the storage space can be further saved during storage, but a conversion process is added.
Example 8
Fig. 7 is a schematic flow chart illustrating a method of storing user evaluation results according to still another embodiment of the present invention.
As shown in fig. 7, a method for storing user evaluation results according to still another embodiment of the present invention includes: step 702, obtaining the rating value of a user for an evaluation item at a client; step 704, the mobile terminal sends the score value to a server; step 706, the server processes the received credit value according to a preset processing rule; at step 708, the score value is stored.
In this embodiment, the data processing is implemented at the server side, and the preset processing rule includes; generating one or more numerical strings from a plurality of individual score values, each of which is
The technical solution of the present invention is described in detail above with reference to the accompanying drawings, and the present invention provides a method for storing user evaluation results, a device for storing user evaluation results, a mobile terminal, a server, and a computer-readable storage medium, wherein after the evaluation values of a user for a plurality of evaluation items are obtained, a plurality of evaluation values are converted into a multi-bit data, i.e. a numerical string, and a relationship between the number of bits of the numerical string and a preset packet number threshold is detected, so that when the number of bits of the numerical string is detected to be smaller than the preset packet number threshold, a preset threshold interval corresponding to the numerical string is directly determined, so as to determine a corresponding data type according to the preset threshold interval, to perform storage identification according to the data type, and to send the storage identification to the server for storage, which is helpful to reduce a storage space compared with a mode in which one byte records one evaluation value in the prior art, thereby relieving the storage pressure on the server side.
The steps in the method of the invention can be sequentially adjusted, combined and deleted according to actual needs.
The units in the device of the invention can be merged, divided and deleted according to actual needs.
It will be understood by those skilled in the art that all or part of the steps in the methods of the embodiments described above may be implemented by hardware instructions of a program, and the program may be stored in a computer-readable storage medium, where the storage medium includes Read-Only Memory (ROM), Random Access Memory (RAM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), One-time Programmable Read-Only Memory (OTPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM), or other Memory, such as a magnetic disk, or a combination thereof, A tape memory, or any other medium readable by a computer that can be used to carry or store data.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (17)

1. A storage method of user evaluation results is suitable for a network car booking client, and is characterized by comprising the following steps:
acquiring scoring values for a plurality of evaluation items;
converting a plurality of the scoring values into at least one numerical string to be stored;
determining a preset threshold interval corresponding to each numerical string so as to determine a corresponding data type according to the preset threshold interval;
converting the numerical value string to be stored into storage data according to the data type;
and sending the storage data to a server so that the server stores the scores according to the storage byte number of the storage data.
2. A storage method of user evaluation results is suitable for a server, and is characterized by comprising the following steps:
receiving the scoring values aiming at the plurality of evaluation items sent by the online taxi appointment client;
converting a plurality of the scoring values into at least one numerical string to be stored;
determining a preset threshold interval corresponding to each numerical string so as to determine a corresponding data type according to the preset threshold interval;
and storing the numerical value string to be stored according to the data type.
3. The method for storing user evaluation results according to claim 1 or 2, wherein the step of converting the plurality of rating values into at least one numerical string to be stored specifically comprises the steps of:
detecting whether the number of bits of the plurality of scoring values is less than or equal to a preset packet number threshold value;
when detecting that the number of bits of the plurality of scoring values is smaller than or equal to the preset packet number threshold value, converting the plurality of scoring values into a numerical string;
grouping the evaluation items when detecting that the number of bits of the plurality of scoring values is larger than the preset grouping number threshold value so as to generate a plurality of data to be stored according to the corresponding data types after grouping,
and the highest bit in each data to be stored represents a packet sequence number.
4. The method according to claim 3, wherein when it is detected that the number of bits of the plurality of rating values is greater than the preset grouping number threshold, the evaluation items are grouped, and after grouping, a plurality of data to be stored are generated according to the corresponding data types, specifically comprising the steps of:
determining the number of the groups according to a first preset data type when the preset group number threshold is a first preset number threshold and the number of the evaluation items is detected to be larger than the first preset number threshold,
the first preset quantity threshold is 9, and the first preset data type is an int data type or a short data type.
5. The method according to claim 3, wherein when it is detected that the number of bits of the plurality of rating values is greater than the preset grouping number threshold, the evaluation items are grouped, and after grouping, a plurality of data to be stored are generated according to the corresponding data types, specifically comprising the steps of:
determining the number of the groups according to a second preset data type when the preset group number threshold is a second preset number threshold and the number of the evaluation items is detected to be larger than the second preset number threshold,
the second preset number threshold is 36, and the second preset data type is a double data type or an int data type.
6. The method for storing user evaluation results according to claim 1 or 2, wherein the step of generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item specifically comprises the following steps:
and generating the decimal numerical string according to the number of the plurality of evaluation items and the score value of each evaluation item.
7. The method for storing user evaluation results according to claim 1 or 2, wherein the step of generating a numerical string to be stored according to the number of the plurality of evaluation items and the score value of each evaluation item specifically comprises the following steps:
determining a scale manner of the score value according to a maximum value among the score values of each of the evaluation items to generate the numerical string according to the scale manner,
wherein, when the maximum value is less than 8, the system is octal or decimal, when the maximum value is greater than or equal to 8 and less than 10, the system is decimal or hexadecimal, when the maximum value is greater than or equal to 10 and less than or equal to 15, the system is hexadecimal.
8. A storage device of user evaluation results is suitable for a network car booking client, and is characterized by comprising:
an acquisition unit configured to acquire score values for a plurality of evaluation items;
the conversion unit is used for converting the plurality of scoring values into at least one numerical string to be stored;
the determining unit is used for determining a preset threshold interval corresponding to each numerical string so as to determine a corresponding data type according to the preset threshold interval;
the conversion unit is further configured to: converting the numerical value string to be stored into storage data according to the data type;
and the sending unit is used for sending the storage data to a server so that the server stores the scores according to the storage byte number of the storage data.
9. A storage device for user evaluation results, adapted to a server, comprising:
the receiving unit is used for receiving the scoring values aiming at the plurality of evaluation items sent by the network car booking client;
the conversion unit is used for converting the plurality of scoring values into at least one numerical string to be stored;
the determining unit is used for determining a preset threshold interval corresponding to each numerical string so as to determine a corresponding data type according to the preset threshold interval;
and the storage unit is used for storing the numerical value string to be stored according to the data type.
10. The apparatus for storing user evaluation results according to claim 8 or 9, further comprising:
the detection unit is used for detecting whether the number of bits of the plurality of scoring values is less than or equal to a preset grouping number threshold value or not;
the conversion unit is further configured to: when detecting that the number of bits of the plurality of scoring values is smaller than or equal to the preset packet number threshold value, converting the plurality of scoring values into a numerical string;
the storage device further includes:
a grouping unit, configured to group the evaluation items when it is detected that the number of bits of the plurality of score values is greater than the preset grouping number threshold, so as to generate a plurality of pieces of data to be stored according to the corresponding data types after grouping,
and the highest bit in each data to be stored represents a packet sequence number.
11. The apparatus for storing user evaluation results according to claim 10,
the determination unit is further configured to: determining the number of the groups according to a first preset data type when the preset group number threshold is a first preset number threshold and the number of the evaluation items is detected to be larger than the first preset number threshold,
the first preset quantity threshold is 9, and the first preset data type is an int data type or a short data type.
12. The apparatus for storing user evaluation results according to claim 10,
the determination unit is further configured to: determining the number of the groups according to a second preset data type when the preset group number threshold is a second preset number threshold and the number of the evaluation items is detected to be larger than the second preset number threshold,
the second preset number threshold is 36, and the second preset data type is a double data type or an int data type.
13. The apparatus for storing user evaluation results according to claim 8 or 9, further comprising:
a generating unit configured to generate the numerical string in decimal according to the number of the plurality of evaluation items and the score value of each of the evaluation items.
14. The apparatus for storing user evaluation results according to claim 8 or 9,
the determination unit is further configured to: determining a scale manner of the score value according to a maximum value among the score values of each of the evaluation items to generate the numerical string according to the scale manner,
wherein, when the maximum value is less than 8, the system is octal or decimal, when the maximum value is greater than or equal to 8 and less than 10, the system is decimal or hexadecimal, when the maximum value is greater than or equal to 10 and less than or equal to 15, the system is hexadecimal.
15. A mobile terminal, characterized in that it comprises a processor for implementing the steps of the method for storing user evaluation results according to any one of claims 1, 3 to 7 when executing a computer program stored in a memory.
16. A server, characterized in that the server comprises a processor for implementing the steps of the method for storing user evaluation results according to any one of claims 2 and 3 to 7 when executing a computer program stored in a memory.
17. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of storing user evaluation results according to any one of claims 1 to 7.
CN201711092700.8A 2017-11-08 2017-11-08 Storage method, device, mobile terminal, server and readable storage medium Active CN109753227B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711092700.8A CN109753227B (en) 2017-11-08 2017-11-08 Storage method, device, mobile terminal, server and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711092700.8A CN109753227B (en) 2017-11-08 2017-11-08 Storage method, device, mobile terminal, server and readable storage medium

Publications (2)

Publication Number Publication Date
CN109753227A CN109753227A (en) 2019-05-14
CN109753227B true CN109753227B (en) 2021-11-23

Family

ID=66402127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711092700.8A Active CN109753227B (en) 2017-11-08 2017-11-08 Storage method, device, mobile terminal, server and readable storage medium

Country Status (1)

Country Link
CN (1) CN109753227B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124291B (en) * 2019-12-09 2023-05-30 北京金山云网络技术有限公司 Data storage processing method and device of distributed storage system and electronic equipment
CN112416947B (en) * 2020-12-09 2023-09-22 吉林师范大学 Remote sensing image database preservation processing method and device
CN113946617A (en) * 2021-10-29 2022-01-18 北京锐安科技有限公司 Data processing method and device, electronic equipment and storage medium
CN114115740B (en) * 2021-11-26 2024-06-07 百度在线网络技术(北京)有限公司 Data storage method and device, data acquisition method and device and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101790257A (en) * 2009-01-22 2010-07-28 大唐移动通信设备有限公司 Method for memorizing data and network management system
US8706727B2 (en) * 2009-06-19 2014-04-22 Sybase, Inc. Data compression for reducing storage requirements in a database system
US8538926B2 (en) * 2011-03-08 2013-09-17 Rackspace Us, Inc. Massively scalable object storage system for storing object replicas
CN102981811A (en) * 2011-09-05 2013-03-20 北大方正集团有限公司 Processing method and device of user option data
CN103885721B (en) * 2012-12-24 2017-11-21 中国移动通信集团公司 A kind of data storage or read method in key assignments system, device

Also Published As

Publication number Publication date
CN109753227A (en) 2019-05-14

Similar Documents

Publication Publication Date Title
CN109753227B (en) Storage method, device, mobile terminal, server and readable storage medium
US20080005648A1 (en) Data compression
CN101594150B (en) Method of efficient compression for measurement data
CN110737818A (en) Network release data processing method and device, computer equipment and storage medium
CN110995273B (en) Data compression method, device, equipment and medium for power database
CN109146083B (en) Feature encoding method and apparatus
CN111260220B (en) Group control equipment identification method and device, electronic equipment and storage medium
CN113132416B (en) Data packet detection method and device
CN110008192A (en) A kind of data file compression method, apparatus, equipment and readable storage medium storing program for executing
CN111526151A (en) Data transmission method and device, electronic equipment and storage medium
CN110689084A (en) Abnormal user identification method and device
CN111723360A (en) Voucher code processing method and device and storage medium
CN108880559B (en) Data compression method, data decompression method, compression equipment and decompression equipment
CN110929173A (en) Method, device, equipment and medium for identifying same person
US7870175B2 (en) Random number generation including skewness control
CN115952398B (en) Traditional calculation method, system and storage medium based on data of Internet of things
CN117294480A (en) Account security detection method and device, electronic equipment and storage medium
CN115865138B (en) Method and device for capturing near field communication signal, electronic equipment and medium
CN112162951A (en) Information retrieval method, server and storage medium
CN109348438B (en) Customer identification method and device in short message communication process
CN109840294B (en) Method for inquiring matching data of electronic element, storage medium and terminal
CN112579566B (en) Distributed ID generation method and device
CN114500670B (en) Encoding compression method, decoding method and device
CN108717438A (en) A kind of chained record state acquisition system and method
CN112069772B (en) FPGA-based data processing method and device, electronic equipment and storage medium

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