CN107908772B - WebSQL multifunctional sequence realization method and device - Google Patents

WebSQL multifunctional sequence realization method and device Download PDF

Info

Publication number
CN107908772B
CN107908772B CN201711239903.5A CN201711239903A CN107908772B CN 107908772 B CN107908772 B CN 107908772B CN 201711239903 A CN201711239903 A CN 201711239903A CN 107908772 B CN107908772 B CN 107908772B
Authority
CN
China
Prior art keywords
sequence
type
value
processing result
processing
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
CN201711239903.5A
Other languages
Chinese (zh)
Other versions
CN107908772A (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.)
Army Engineering University of PLA
Original Assignee
Army Engineering University of PLA
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 Army Engineering University of PLA filed Critical Army Engineering University of PLA
Priority to CN201711239903.5A priority Critical patent/CN107908772B/en
Publication of CN107908772A publication Critical patent/CN107908772A/en
Application granted granted Critical
Publication of CN107908772B publication Critical patent/CN107908772B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a WebSQL multifunctional sequence realization method and a WebSQL multifunctional sequence realization device, wherein the method comprises the following steps: receiving sequence information to be processed, wherein the sequence information comprises a plurality of parameter information, and the parameter information comprises a sequence type, a starting value, a step value, an ending value and a cycle identifier; detecting whether the sequence type is a specified type; if the sequence type is not the specified type, outputting error information, if the sequence type is the specified type, judging a subtype to which the sequence type belongs, and executing a processing scheme corresponding to the subtype on the starting value; and when the processing result is equal to the end value and the loop identifier represents the end of the loop, ending the processing process of the sequence information. The WebSQL multifunctional sequence implementation scheme solves the problem that WebSQL of HTML5 does not have a sequence mechanism, expands the functions of a common sequence, sets different processing schemes according to different sequence types to obtain a processing result, and improves the rationality of sequence processing.

Description

WebSQL multifunctional sequence realization method and device
Technical Field
The invention relates to the technical field of computer web development, in particular to a WebSQL multifunctional sequence realization method and device.
Background
At present, the technology of HTML5 has been widely applied, and the implementation of local storage of web pages by using WebSQL can improve the execution efficiency and reduce the load on the server. However, WebSQL does not have a sequence mechanism, databases such as Oracle and SQL Server support sequence or automatic growth, but only change data in a certain interval, and from the above problem analysis, the inventors have recognized that WebSQL is not only lacking automatic growth of simple values, but also does not have a flexible operation function.
Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for implementing WebSQL multifunctional sequences to solve the above problems.
The preferred embodiment of the invention provides a WebSQL multifunctional sequence realization method, which comprises the following steps:
receiving sequence information to be processed input into a WebSQL database, wherein the sequence information comprises a plurality of parameter information, and the parameter information comprises a sequence type, a starting value, a step value, an ending value and a cycle identifier;
detecting whether the sequence type is a specified type, wherein the specified type comprises a plurality of subtypes;
if the starting value is not the specified type, outputting error information indicating that the sequence type is wrong, if the starting value is the specified type, judging a subtype to which the sequence type belongs, and executing a processing scheme corresponding to the subtype on the starting value;
and when the processed processing result is equal to the end value, judging whether the cycle identifier is characterized as cycle end, if so, ending the processing process of the sequence information, and if not, returning to execute the step of detecting whether the sequence type is the specified type.
Optionally, in the method, the subtype includes a character type, and the determining the subtype to which the sequence type belongs and performing a processing scheme corresponding to the subtype on the start value includes:
when the sequence type is judged to be a character type, converting the starting value into a corresponding ASCII code, and processing the converted starting value according to the following formula to obtain a processing result:
NEXTVAL=START+N*STEP
wherein NEXTVAL is a numeric processing result, START is a START value converted into ASCII code, STEP is a STEP value, and N is an execution number of times, which is an integer greater than or equal to 0;
and performing type conversion on the obtained numerical type processing result to obtain a character type processing result.
Optionally, in the method, the subtype includes a numerical type, and the step of determining the subtype to which the sequence type belongs and executing the processing scheme corresponding to the subtype on the start value includes:
when the sequence type is judged to be a numerical type, the starting value is directly processed according to the following formula to obtain a processing result:
NEXTVAL=START+N*STEP
where NEXTVAL is the processing result, START is the START value, STEP is the STEP value, and N is the number of executions and is an integer greater than or equal to 0.
Optionally, in the method, the determining a subtype to which the sequence type belongs and executing a processing scheme corresponding to the subtype on the start value includes:
when the sequence type is detected to be a combination type of colon and character string, converting the starting value into a corresponding ASCII code, and processing the converted starting value according to the following formula to obtain a processing result:
NEXTVAL=START+N*STEP
wherein, NEXTVAL is the processing result, START is the starting value of conversion into ASCII code, STEP is the STEP value, N is the execution number, is an integer greater than or equal to 0;
carrying out type conversion on the obtained numerical type processing result to obtain a character type processing result;
and combining the character string with the obtained character type processing result to obtain a combined processing result.
Optionally, in the method, the determining a subtype to which the sequence type belongs and executing a processing scheme corresponding to the subtype on the start value includes:
and when the sequence type is detected to be a combined type of the double quotation marks and the function character strings, processing the starting value according to the function to obtain a corresponding processing result.
Optionally, in the above method, the method further comprises:
creating a sequence definition table, respectively writing a sequence number, a sequence name and a plurality of parameter information of the sequence into the sequence definition table, obtaining writing time of the sequence written into the sequence definition table and deleting time of the sequence deleted from the sequence definition table, and recording the writing time and the deleting time in the sequence definition table;
creating a sequence running table associated with the sequence definition table, obtaining a running number of a sequence recorded in the sequence definition table and a sequence number of the sequence, and recording the running number, the sequence number and processing update time of the sequence in the sequence running table;
and creating a history record table associated with the sequence definition table, obtaining the operation name, the operation type and the operation time of the sequence recorded in the sequence definition table, and recording the sequence number of the sequence, the operation name, the operation type and the operation time in the history record table.
Another preferred embodiment of the present invention provides a WebSQL multifunctional sequence implementing device, including:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving sequence information to be processed which is input into a WebSQL database, the sequence information comprises a plurality of parameter information, and the parameter information comprises a sequence type, a starting value, a step value, an ending value and a cycle identifier;
the detection module is used for detecting whether the sequence type is a specified type, and the specified type comprises a plurality of subtypes;
the output module is used for outputting error information indicating that the sequence type is wrong when the sequence type is not the specified type;
the execution module is used for judging the subtype to which the sequence type belongs when the sequence type is the specified type, and executing a processing scheme corresponding to the subtype on the starting value;
the judging module is used for judging whether the cycle identifier is characterized as cycle end or not when the processed processing result is equal to the end value;
the ending module is used for ending the processing process of the sequence information when the cycle identifier is characterized as the cycle ending;
and the return module is used for returning and executing the step of detecting whether the sequence type is the specified type when the cycle identifier is not characterized as the end of the cycle.
Optionally, in the above apparatus, the execution module includes a first conversion unit and a second conversion unit;
a first conversion unit, configured to, when it is determined that the sequence type is a character type, convert the start value into a corresponding ASCII code, and process the converted start value according to the following formula, to obtain a processing result:
NEXTVAL=START+N*STEP
wherein NEXTVAL is a numeric processing result, START is a START value converted into ASCII code, STEP is a STEP value, and N is an execution number of times, which is an integer greater than or equal to 0;
and the second conversion unit is used for carrying out type conversion on the obtained numerical processing result to obtain a character-type processing result.
Optionally, in the above apparatus, the execution module further includes an execution unit, and the execution unit is configured to, when it is detected that the sequence type is a combination of a double quotation mark and a function string, process the start value according to the function to obtain a corresponding processing result.
Optionally, in the above apparatus, the apparatus further includes a first establishing module, a second establishing module, and a third establishing module;
the first establishing module is used for establishing a sequence definition table, respectively writing a sequence number, a sequence name and a plurality of parameter information of the sequence into the sequence definition table, obtaining writing time of the sequence written into the sequence definition table and deleting time of the sequence deleted from the sequence definition table, and recording the writing time and the deleting time into the sequence definition table;
the second establishing module is used for establishing a sequence running table associated with the sequence definition table, obtaining a running number of a sequence recorded in the sequence definition table and a sequence number of the sequence, and recording the running number, the sequence number and processing update time of the sequence in the sequence running table;
the third establishing module is used for establishing a history record table associated with the sequence definition table, obtaining the operation name, the operation type and the operation time of the sequence recorded in the sequence definition table, and recording the sequence number of the sequence, the operation name, the operation type and the operation time in the history record table.
The WebSQL multifunctional sequence realization method and the WebSQL multifunctional sequence realization device provided by the embodiment of the invention determine the sequence type through judging the type of the sequence, and carry out corresponding processing on the sequence starting value by adopting a corresponding processing scheme according to the sequence type to obtain a processing result. And ending the processing process of the sequence when the cycle identification of the sequence represents the end of the cycle. The WebSQL multifunctional sequence implementation scheme solves the problem that WebSQL of HTML5 does not have a sequence mechanism, expands the functions of a common sequence, sets different processing schemes according to different sequence types to obtain a processing result, and improves the rationality of sequence processing.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a block diagram of an electronic device according to an embodiment of the present invention.
Fig. 2 is a flowchart of a WebSQL multifunctional sequence implementation method provided in an embodiment of the present invention.
Fig. 3 is a flowchart of the substeps of step S104 in fig. 2.
Fig. 4 is another flowchart of the substeps of step S104 in fig. 2.
Fig. 5 is another flowchart of a WebSQL multifunctional sequence implementation method according to an embodiment of the present invention.
Fig. 6 is a functional module block diagram of a WebSQL multifunctional sequence implementation apparatus according to an embodiment of the present invention.
Fig. 7 is a functional block diagram of an execution module according to an embodiment of the present invention.
Fig. 8 is another functional module block diagram of the WebSQL multifunctional sequence implementing device according to the embodiment of the present invention.
Icon: 100-an electronic device; 110-WebSQL multifunctional sequence realizing device; 111-a receiving module; 112-a detection module; 113-an output module; 114-an execution module; 1141-a first conversion unit; 1142-a second conversion unit; 1143-an execution unit; 115-a judgment module; 116-end module; 117-return module; 118-a first setup module; 119-a second building block; 1191-a third setup module; 120-a processor; 130-memory.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Fig. 1 is a block diagram of an electronic device 100 according to an embodiment of the invention. In this embodiment, the electronic device 100 includes a WebSQL multifunction sequence implementing device 110, a processor 120, and a memory 130. Wherein, the memory 130 is electrically connected with the processor 120 directly or indirectly to realize the data transmission or interaction. The WebSQL multifunctional sequence implementing means 110 comprises at least one software functional module that can be stored in the memory 130 in the form of software or firmware or solidified in the operating system of the electronic device 100. The processor 120 is configured to execute an executable module stored in the memory 130, such as a software functional module or a computer program included in the WebSQL multifunctional sequence implementing device 110, to process sequence information.
In this embodiment, the electronic device 100 may be, but is not limited to, a terminal device with data processing capability, such as a personal computer, a notebook computer, and the like.
Fig. 2 is a schematic flowchart of a WebSQL multifunctional sequence implementation method applied to the electronic device 100 shown in fig. 1 according to an embodiment of the present invention. It should be noted that the method provided by the present embodiment is not limited by the sequence shown in fig. 2 and described below. The specific process shown in fig. 2 will be described in detail below.
Step S101, receiving sequence information to be processed input into a WebSQL database, wherein the sequence information comprises a plurality of parameter information, and the parameter information comprises a sequence type, a starting value, a step value, an ending value and a cycle identifier.
The WebSQL database is also known as an HTML5 local database, and is a lightweight database which is added with the HTML5 specification and runs on a browser side. In the HTML5, the content that can be stored locally at the client is greatly enriched, and a plurality of functions are added to convert the data that must be stored in the server originally to be stored locally at the client, so that the performance of the Web application program is greatly improved, and the burden of the server is reduced.
At present, WebSQL does not have a sequence mechanism, so that various defects exist, for example, if WebSQL does not have a sequence, automatic increase of inserted data cannot be realized, the data cannot be changed according to an alphabetical mode, fixed character string prefixes cannot be added into the data needing to be changed, a certain specified algorithm cannot be executed, and the like. In view of the foregoing drawbacks, embodiments of the present invention provide a scheme for implementing a WebSQL multifunctional sequence, so as to overcome sequence defects of the existing WebSQL.
In this embodiment, sequence information to be processed may be received externally, where the sequence information includes a plurality of parameter information that may be used to implement a sequence. The parameter information includes a sequence type, a start value, a step value, an end value, a cycle identifier, and the like.
Step S102, detecting whether the sequence type is a designated type, where the designated type includes multiple subtypes, if the sequence type is the designated type, executing the following step S103, and if the sequence type is not the designated type, executing the following step S104.
In step S103, error information indicating that the sequence type is erroneous is output.
Step S104, judging the subtype to which the sequence type belongs, and executing the processing scheme corresponding to the subtype on the starting value.
In this embodiment, the processing procedure can be implemented for a sequence of a specified type, and therefore, it is required to first detect whether the sequence type included in the sequence information is a preset specified type. Optionally, in this embodiment, the specified type includes a plurality of sub-types, such as a character type, a numerical type, a combination type of colon and character string, and the like. And detecting whether the sequence type belongs to any one of the designated types, and if the sequence type does not belong to any one of the designated types, outputting error information indicating that the sequence type is wrong, wherein the error information indicates that the sequence information of the type cannot be processed.
If the sequence type belongs to one of the designated types, determining the information of the subtype to which the sequence type specifically belongs, and then processing the starting value contained in the sequence information according to a processing scheme preset in the system and corresponding to the subtype to obtain a processing result.
As can be seen from the above, the WebSQL multifunctional sequence implementation scheme provided in this embodiment can process a character-type sequence type. Optionally, referring to fig. 3, in the present embodiment, the step S104 may include two substeps, i.e., a step S1041 and a step S1042.
Step S1041, when it is determined that the sequence type is a character type, converting the start value into a corresponding ASCII code, and processing the converted start value according to the following formula to obtain a processing result:
NEXTVAL=START+N*STEP
where NEXTVAL is a numeric processing result, START is a START value converted into ASCII code, STEP is a STEP value, and N is an execution number, and is an integer equal to or greater than 0.
In step S1042, type conversion is performed on the obtained numeric type processing result to obtain a character type processing result.
In this embodiment, after the sequence type is determined to be a preset specified type, a specific subtype to which the sequence type belongs is determined. Optionally, in this embodiment, if it is determined that the sequence type is a character type, for example, an uppercase letter such as A, B, C or another character type, it indicates that the START value START included in the sequence information is also a character type. The START value START is converted into a corresponding ASCII code before the iterative processing of the START value START. That is, at the first call, the original value of the START value START is obtained, and at the second call, the sum of the START value START converted ASCII code and the STEP value STEP is obtained. In this embodiment, the number of execution times N in the above equation is set to a value from 0, and then increases in order.
Optionally, after each iteration, the resulting NEXTVAL may be converted to a corresponding glyph for subsequent storage. In this case, since the end value included in the sequence information is also in a character form, it is necessary to convert the iterative numerical processing result NEXTVAL into a character form so as to compare the character form end value with the character form end value. In this embodiment, the end flag of the iterative process is that the obtained processing result is equal to the end value, that is, when the obtained processing result is equal to the end value, the subsequent detection and judgment process is performed.
As can be seen from the above, the WebSQL multifunctional sequence implementation scheme provided in this embodiment can process numerical sequence types. Optionally, in this embodiment, step S104 may also be implemented by:
when the sequence type is judged to be a numerical type, the starting value is directly processed according to the following formula to obtain a processing result:
NEXTVAL=START+N*STEP
where NEXTVAL is the processing result, START is the START value, STEP is the STEP value, and N is the number of executions and is an integer greater than or equal to 0.
In this embodiment, after the sequence type is determined to be a preset specified type, a specific subtype to which the sequence type belongs is determined. Optionally, in this embodiment, if it is determined that the sequence type is a numerical type, for example, a number such as 1, 2, 3, or another numerical type, it indicates that the START value START included in the sequence information is also a numerical type.
In this case, the start value is not required to be pre-converted, and the start value can be directly processed according to the above iterative formula to obtain a numerical processing result NEXTVAL. In the processing, the number of execution times N in the above equation increases in order from 0. The specific output result is as follows: the first time NEXTVAL is called, the value returned is START, the second time START + STEP, the third time START + STEP 2, and so on.
Alternatively, in this case, if the START value START and the STEP value STEP are both integers, the resulting processing result NEXTVAL is output as an integer value, otherwise the processing result NEXTVAL is output as a floating-point result.
Optionally, the WebSQL multifunctional sequence implementation scheme provided in this embodiment may also process other sequence types, such as a combination type of colon and character strings, a combination type of double quotation marks and function character strings, and the like. Referring to fig. 4, in the present embodiment, the step S104 may further include the following steps:
step S1043, when detecting that the sequence type is a combination type of colon and character string, converting the start value into a corresponding ASCII code, and processing the converted start value according to the following formula to obtain a processing result:
NEXTVAL=START+N*STEP
where NEXTVAL is a processing result, START is a START value converted into ASCII code, STEP is a STEP value, and N is an integer of 0 or more in the number of executions.
In step S1044, the obtained numeric processing result is subjected to type conversion to obtain a character-type processing result.
Step S1045, combining the character string with the obtained character type processing result to obtain a combined processing result.
In this embodiment, if it is detected that the sequence type is a combination type of colon and character string, that is, a type with a character string at the beginning and the end of the colon, for example, zhangsan, it indicates that a corresponding character string needs to be carried in front of a subsequently obtained processing result as a prefix. Alternatively, the colon may be a colon in the english edition half-corner mode.
In this case, the start value is first converted into a corresponding ASCII code, and the converted start value is processed according to the above formula to obtain a processing result. The specific processing procedure is the same as the above-mentioned processing procedure for the character-type start value, and is not described herein again.
After the final processing result is obtained, the obtained processing result is subjected to type conversion to be converted into a character-type processing result. And adding the character string in front of the obtained processing result to obtain a combined processing result.
Further, in the present embodiment, step S104 may also be performed by:
and when the sequence type is detected to be a combined type of the double quotation marks and the function character strings, processing the starting value according to the function to obtain a corresponding processing result.
In this embodiment, if it is detected that the sequence type is a combination type of a diacritic and a function string, for example, the form is "sum", where sum represents summation. The start value may be processed according to the function, the start value may be accumulated and summed, and a corresponding processing result may be obtained after performing a plurality of summation processes. Optionally, in this embodiment, the double quotation marks may be double quotation marks in an english version. Optionally, the function string may also be in other types of function forms, which are not listed in this embodiment one by one, and only needs to perform corresponding processing on the start value according to a function in the double quotation marks.
Optionally, in this embodiment, when detecting the sequence type, it may be detected whether the sequence type is a character type, and if not, it may be detected whether the sequence type is a numerical type, and if not, it may be detected whether the sequence type is a combination type of a colon and a character string, and if not, it may be detected whether the sequence type is another type. Or whether the detection is numerical type or not can be detected, and whether the detection is character type or not is detected under the condition that the detection is not numerical type, and then whether the detection is other types or not is detected. That is, the detection sequence of the types is not limited in this embodiment, and may be set according to the requirement.
And step S105, when the processed processing result is equal to the end value, judging whether the cycle identifier is characterized as cycle end, if the cycle identifier is characterized as cycle end, executing the following step S106, and if the cycle identifier is not characterized as cycle end, returning to execute the step of detecting whether the sequence type is the specified type.
And step S106, ending the processing process of the sequence information.
In this embodiment, in the above processing process, the processing result obtained from each iteration may be compared with the end value, and when the processed processing result is equal to the end value, it is determined whether the loop identifier is characterized as a loop end. In this embodiment, whether to loop may be determined by detecting whether the loop identifier is FALSE or TRUE. In this embodiment, the loop flag is typically set to FALSE, i.e., indicating no loop. If the loop identifier is detected to be FALSE, ending the processing process of the sequence information to obtain processed sequence information, including the iteration result, the sequence type, the start value, the end value and the like of each iteration, which can form a sequence. And if the loop identifier is detected to be TRUE, resetting the execution times N to be 0, and then returning to execute the step of detecting whether the sequence type is the specified type.
Optionally, referring to fig. 5, in this embodiment, the method further includes the following steps:
step S201, creating a sequence definition table, writing the sequence number, the sequence name, and the parameter information of the sequence into the sequence definition table, respectively, obtaining a writing time for writing the sequence into the sequence definition table and a deleting time for deleting the sequence from the sequence definition table, and recording the writing time and the deleting time in the sequence definition table.
Step S202, creating a sequence running table associated with the sequence definition table, obtaining a running number of the sequence recorded in the sequence definition table and a sequence number of the sequence, and recording the running number, the sequence number, and the processing update time of the sequence in the sequence running table.
Step S203, creating a history table associated with the sequence definition table, obtaining the operation name, the operation type, and the operation time of the sequence recorded in the sequence definition table, and recording the sequence number of the sequence, the operation name, the operation type, and the operation time in the history table.
In this embodiment, in order to store the obtained sequence information and record the sequence processing procedure, in this embodiment, three association tables are created, which are a sequence definition table, a sequence operation table, and a history table. The sequence definition table is a main table and mainly defines static data and operation rules of the sequence. The sequence running table mainly records the running state of the sequence. The history table is mainly used for recording the use condition of the log for history inquiry and statistics. Optionally, the sequence number of the sequence, the sequence name, and the above parameter information, including the sequence type, the start value, the step value, the end value, and the cycle identifier, may be written into the created sequence definition table, respectively. And a writing time of the sequence in the writing of the sequence in the sequence definition table and a deletion time of the sequence deleted from the sequence definition table may be acquired. And then recording the writing time and the deleting time into the sequence definition table. The sequence definition table created in this embodiment can be referred to as table 1 below.
TABLE 1
Column name Name of Chinese Remarks for note
SeqId Serial number Primary Key, randomly generated 18-bit unique value
SeqName Sequence name
TYPE Sequence type For input values, refer to abstract front page of specification
START Start value
STEP Step by step value
END End value
LOOP Circulation mark
UpdateTime Update time Each time insert and update are executed, system time is filled in
DelTime Delete time When deleted, update is executed, otherwise, it is empty
Optionally, the sequence running table is associated with the sequence definition table, and may record a running state of a sequence in the sequence definition table, including a sequence number of the sequence, a running number of the sequence, a processing update time of the sequence, and the like. The sequence running table established in this embodiment can be seen in table 2 below.
TABLE 2
Column name Name of Chinese Remarks for note
RunId Running number Primary Key, randomly generated 18-bit unique value
SeqId Serial number Foreign key, SeqId referencing SeqDefine
CurVal Current value
UpdateTime Update time Recording the time of change
DelTime Delete time When deleted, update is executed, otherwise, it is empty
The history table is associated with the sequence definition table, and mainly records operation names of the sequences in the sequence definition table, such as information of operators. Also included are operation types, such as delete, modify, add, or other operation types, and operation times, among others. Log information is formed for historical querying and logging. The history table created in this embodiment can be referred to in table 3 below.
TABLE 3
Column name Name of Chinese Remarks for note
SeqId Serial number Foreign key, SeqId referencing SeqDefine
OperateName Name of operation
OperateType Type of operation
UpdateTime Update time Recording operating time
DelTime Delete time When deleted, update is executed, otherwise, it is empty
Please refer to fig. 6, which is a functional module block diagram of a WebSQL multifunctional sequence implementation apparatus 110 according to an embodiment of the present invention. The WebSQL multifunctional sequence implementing device 110 is applied to the electronic device 100 described above, and the WebSQL multifunctional sequence implementing device 110 includes a receiving module 111, a detecting module 112, an output module 113, an executing module 114, a judging module 115, an ending module 116, and a returning module 117.
The receiving module 111 is configured to receive sequence information to be processed input into the WebSQL database, where the sequence information includes a plurality of parameter information, and the parameter information includes a sequence type, a start value, a step value, an end value, and a cycle identifier.
The detection module 112 is configured to detect whether the sequence type is a specific type, where the specific type includes a plurality of subtypes.
The output module 113 is configured to output error information indicating that the sequence type is incorrect when the sequence type is not the specified type.
The execution module 114 is configured to determine a subtype to which the sequence type belongs when the sequence type is the specified type, and execute a processing scheme corresponding to the subtype on the start value.
The judging module 115 is configured to judge whether the loop identifier is characterized as a loop end when the processed processing result is equal to the end value.
The ending module 116 is configured to end the processing procedure of the sequence when the loop identifier is characterized as the end of the loop.
The returning module 117 is configured to return to perform the step of detecting whether the sequence type is a specified type when the loop identifier is not characterized as the end of the loop.
Optionally, referring to fig. 7, in the present embodiment, the execution module 114 includes a first conversion unit 1141 and a second conversion unit 1142.
The first conversion unit 1141 is configured to, when it is determined that the sequence type is a character type, convert the start value into a corresponding ASCII code, and process the converted start value according to the following formula to obtain a processing result: next, next is a numeric processing result, START is a START value converted into ASCII code, STEP is a STEP value, and N is an execution count and is an integer equal to or greater than 0.
The second conversion unit 1142 is configured to perform type conversion on the obtained numeric type processing result to obtain a character type processing result.
In this embodiment, the execution module 114 further includes an execution unit 1143, where the execution unit 1143 is configured to process the start value according to the function when detecting that the sequence type is a combination of a double quotation mark and a function character string, so as to obtain a corresponding processing result.
Optionally, referring to fig. 8, in the present embodiment, the apparatus further includes a first establishing module 118, a second establishing module 119, and a third establishing module 1191.
The first establishing module 118 is configured to create a sequence definition table, write the sequence number, the sequence name, and the parameter information of the sequence into the sequence definition table, obtain a write time when the sequence is written into the sequence definition table and a delete time when the sequence is deleted from the sequence definition table, and record the write time and the delete time in the sequence definition table.
The second establishing module 119 is configured to create a sequence running table associated with the sequence definition table, obtain a running number of a sequence and a sequence number of the sequence recorded in the sequence definition table, and record the running number, the sequence number, and processing update time of the sequence in the sequence running table.
The third establishing module 1191 is configured to create a history table associated with the sequence definition table, obtain an operation name, an operation type, and an operation time of a sequence recorded in the sequence definition table, and record a sequence number of the sequence, the operation name, the operation type, and the operation time in the history table.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
In summary, the method and the device for implementing the WebSQL multifunctional sequence provided by the embodiments of the present invention determine the sequence type by determining the type to which the sequence belongs, and perform corresponding processing on the sequence start value by using a corresponding processing scheme according to the sequence type to obtain a processing result. And ending the processing process of the sequence when the cycle identification of the sequence represents the end of the cycle. The WebSQL multifunctional sequence implementation scheme solves the problem that WebSQL of HTML5 does not have a sequence mechanism, expands the functions of a common sequence, sets different processing schemes according to different sequence types to obtain a processing result, and improves the rationality of sequence processing.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
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. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A WebSQL multifunctional sequence implementation method is characterized by comprising the following steps:
receiving sequence information to be processed input into a WebSQL database, wherein the sequence information comprises a plurality of parameter information, and the parameter information comprises a sequence type, a starting value, a step value, an ending value and a cycle identifier;
detecting whether the sequence type is a specified type, wherein the specified type comprises a plurality of subtypes;
if the starting value is not the specified type, outputting error information indicating that the sequence type is wrong, if the starting value is the specified type, judging a subtype to which the sequence type belongs, and executing a processing scheme corresponding to the subtype on the starting value;
when the processed processing result is equal to the end value, judging whether the cycle identifier is characterized as cycle end or not, if the cycle identifier is characterized as cycle end, ending the processing process of the sequence information, and if the cycle identifier is not characterized as cycle end, returning to execute the step of detecting whether the sequence type is the specified type or not;
the method further comprises the following steps:
creating a sequence definition table, respectively writing a sequence number, a sequence name and a plurality of parameter information of the sequence into the sequence definition table, obtaining writing time of the sequence written into the sequence definition table and deleting time of the sequence deleted from the sequence definition table, and recording the writing time and the deleting time in the sequence definition table;
and creating a history record table associated with the sequence definition table, obtaining the operation name, the operation type and the operation time of the sequence recorded in the sequence definition table, and recording the sequence number of the sequence, the operation name, the operation type and the operation time in the history record table.
2. The WebSQL multifunctional sequence implementation method of claim 1, wherein the sub-type comprises a character type, and the step of determining the sub-type to which the sequence type belongs and executing the processing scheme corresponding to the sub-type on the start value comprises:
when the sequence type is judged to be a character type, converting the starting value into a corresponding ASCII code, and processing the converted starting value according to the following formula to obtain a processing result:
NEXTVAL=START+N*STEP
wherein NEXTVAL is a numeric processing result, START is a START value converted into ASCII code, STEP is a STEP value, and N is an execution number of times, which is an integer greater than or equal to 0;
and performing type conversion on the obtained numerical type processing result to obtain a character type processing result.
3. The method of WebSQL multifunctional sequence implementation of claim 1, wherein the subtype comprises a numeric type, and the step of determining the subtype to which the sequence type belongs and executing the processing scheme corresponding to the subtype on the start value comprises:
when the sequence type is judged to be a numerical type, the starting value is directly processed according to the following formula to obtain a processing result:
NEXTVAL=START+N*STEP
where NEXTVAL is the processing result, START is the START value, STEP is the STEP value, and N is the number of executions and is an integer greater than or equal to 0.
4. The method for WebSQL multifunctional sequence implementation according to claim 1, wherein the step of determining the subtype to which the sequence type belongs and executing the processing scheme corresponding to the subtype on the start value includes:
when the sequence type is detected to be a combination type of colon and character string, converting the starting value into a corresponding ASCII code, and processing the converted starting value according to the following formula to obtain a processing result:
NEXTVAL=START+N*STEP
wherein, NEXTVAL is the processing result, START is the starting value of conversion into ASCII code, STEP is the STEP value, N is the execution number, is an integer greater than or equal to 0;
carrying out type conversion on the obtained numerical type processing result to obtain a character type processing result;
and combining the character string with the obtained character type processing result to obtain a combined processing result.
5. The method for WebSQL multifunctional sequence implementation according to claim 1, wherein the step of determining the subtype to which the sequence type belongs and executing the processing scheme corresponding to the subtype on the start value includes:
and when the sequence type is detected to be the combination of the double quotation marks and the function character strings, processing the starting value according to the function to obtain a corresponding processing result.
6. The WebSQL multifunctional sequence implementation method of claim 1, further comprising:
creating a sequence running table associated with the sequence definition table, obtaining a running number of a sequence recorded in the sequence definition table and a sequence number of the sequence, and recording the running number, the sequence number and processing update time of the sequence in the sequence running table.
7. A WebSQL multifunctional sequence realization device is characterized in that the device comprises:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving sequence information to be processed which is input into a WebSQL database, the sequence information comprises a plurality of parameter information, and the parameter information comprises a sequence type, a starting value, a step value, an ending value and a cycle identifier;
the detection module is used for detecting whether the sequence type is a specified type, and the specified type comprises a plurality of subtypes;
the output module is used for outputting error information indicating that the sequence type is wrong when the sequence type is not the specified type;
the execution module is used for judging the subtype to which the sequence type belongs when the sequence type is the specified type, and executing a processing scheme corresponding to the subtype on the starting value;
the judging module is used for judging whether the cycle identifier is characterized as cycle end or not when the processed processing result is equal to the end value;
the ending module is used for ending the processing process of the sequence information when the cycle identifier is characterized as the cycle ending;
a return module, configured to return to execute the step of detecting whether the sequence type is a specified type when the loop identifier is not characterized as a loop end;
the device also comprises a first establishing module and a third establishing module:
the first establishing module is used for establishing a sequence definition table, respectively writing a sequence number, a sequence name and a plurality of parameter information of the sequence into the sequence definition table, obtaining writing time of the sequence written into the sequence definition table and deleting time of the sequence deleted from the sequence definition table, and recording the writing time and the deleting time into the sequence definition table;
the third establishing module is used for establishing a history record table associated with the sequence definition table, obtaining the operation name, the operation type and the operation time of the sequence recorded in the sequence definition table, and recording the sequence number of the sequence, the operation name, the operation type and the operation time in the history record table.
8. The WebSQL multifunctional sequence implementation device of claim 7, wherein the execution module comprises a first conversion unit and a second conversion unit;
a first conversion unit, configured to, when it is determined that the sequence type is a character type, convert the start value into a corresponding ASCII code, and process the converted start value according to the following formula, to obtain a processing result:
NEXTVAL=START+N*STEP
wherein NEXTVAL is a numeric processing result, START is a START value converted into ASCII code, STEP is a STEP value, and N is an execution number of times, which is an integer greater than or equal to 0;
and the second conversion unit is used for carrying out type conversion on the obtained numerical processing result to obtain a character-type processing result.
9. The WebSQL multifunctional sequence implementation device of claim 7, wherein the execution module further comprises an execution unit, and the execution unit is configured to process the start value according to the function to obtain a corresponding processing result when the sequence type is detected to be a combination of a diacritic and a function string.
10. The WebSQL multi-functional sequence implementation device of claim 7, wherein the device further comprises a second building module;
the second establishing module is configured to create a sequence running table associated with the sequence definition table, obtain a running number of a sequence recorded in the sequence definition table and a sequence number of the sequence, and record the running number, the sequence number, and processing update time of the sequence in the sequence running table.
CN201711239903.5A 2017-11-30 2017-11-30 WebSQL multifunctional sequence realization method and device Active CN107908772B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711239903.5A CN107908772B (en) 2017-11-30 2017-11-30 WebSQL multifunctional sequence realization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711239903.5A CN107908772B (en) 2017-11-30 2017-11-30 WebSQL multifunctional sequence realization method and device

Publications (2)

Publication Number Publication Date
CN107908772A CN107908772A (en) 2018-04-13
CN107908772B true CN107908772B (en) 2020-10-30

Family

ID=61849662

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711239903.5A Active CN107908772B (en) 2017-11-30 2017-11-30 WebSQL multifunctional sequence realization method and device

Country Status (1)

Country Link
CN (1) CN107908772B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477532A (en) * 2008-12-23 2009-07-08 北京畅游天下网络技术有限公司 Method, apparatus and system for implementing data storage and access
CN105678052A (en) * 2015-12-29 2016-06-15 上海联影医疗科技有限公司 DICOM file management method and management system
CN106649736A (en) * 2016-12-23 2017-05-10 成都信息工程大学 Generation method for automatic codes in general database
CN106940712A (en) * 2017-03-01 2017-07-11 星环信息科技(上海)有限公司 Sequence generating method and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477532A (en) * 2008-12-23 2009-07-08 北京畅游天下网络技术有限公司 Method, apparatus and system for implementing data storage and access
CN105678052A (en) * 2015-12-29 2016-06-15 上海联影医疗科技有限公司 DICOM file management method and management system
CN106649736A (en) * 2016-12-23 2017-05-10 成都信息工程大学 Generation method for automatic codes in general database
CN106940712A (en) * 2017-03-01 2017-07-11 星环信息科技(上海)有限公司 Sequence generating method and equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
oracle 创建字段自增长——两种实现方式汇总(转);用户weixin_33759269;《CSDN》;20150728;第1-8页 *
oracle中序列和触发器的使用;用户rrjkhn;《豆丁网》;20170529;第1-2页 *
字母序列递增,即A+1=B,B+2=D,ASCII;用户落雪凝辰;《博客园》;20151219;第1-2页 *

Also Published As

Publication number Publication date
CN107908772A (en) 2018-04-13

Similar Documents

Publication Publication Date Title
US10705748B2 (en) Method and device for file name identification and file cleaning
US8904352B2 (en) Systems and methods for processing source code during debugging operations
AU2018203442B2 (en) Program code comparison and reporting
CN110781183B (en) Processing method and device for incremental data in Hive database and computer equipment
US10261884B2 (en) Method for correcting violation of source code and computer readable recording medium having program performing the same
CN108595338A (en) Test case write method, device, computer equipment and storage medium
JP2012113606A (en) Protection object information masking device, protection object information masking method, and protection object information masking program
CN115757629A (en) Multi-source heterogeneous data increment synchronization method and system, storage medium and electronic equipment
CN111475196B (en) Compiling alarm tracing method and device, electronic equipment and computer readable medium
CN110837471A (en) Test method, test device, server and storage medium
JP4610360B2 (en) Duplicate website detection device
JP5731361B2 (en) Character string conversion method and character string conversion program
US9390073B2 (en) Electronic file comparator
CN107908772B (en) WebSQL multifunctional sequence realization method and device
KR101742041B1 (en) an apparatus for protecting private information, a method of protecting private information, and a storage medium for storing a program protecting private information
JP2013242782A (en) Character string conversion method and program
JP6870454B2 (en) Analytical equipment, analytical programs and analytical methods
US20130262451A1 (en) Analysis support apparatus, analysis support method and analysis support program
JP2016057715A (en) Graphic type program analyzer
CN115599388A (en) API (application programming interface) document generation method, storage medium and electronic equipment
CN114254591A (en) Construction method and device of simplified and traditional conversion tool
JP2022014966A (en) Information processing device, domain organization information production device, information processing method, domain organization information production method, and program
CN106407350A (en) Method and device for filtering error log information
JP6123372B2 (en) Information processing system, name identification method and program
CN106326209B (en) Tibetan character error detection method and system and Tibetan character string error detection method and system

Legal Events

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