CN107368320B - Simple early exercise data statistical system - Google Patents

Simple early exercise data statistical system Download PDF

Info

Publication number
CN107368320B
CN107368320B CN201710612513.1A CN201710612513A CN107368320B CN 107368320 B CN107368320 B CN 107368320B CN 201710612513 A CN201710612513 A CN 201710612513A CN 107368320 B CN107368320 B CN 107368320B
Authority
CN
China
Prior art keywords
file
student
early
data
map set
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.)
Expired - Fee Related
Application number
CN201710612513.1A
Other languages
Chinese (zh)
Other versions
CN107368320A (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.)
Nanjing Forestry University
Original Assignee
Nanjing Forestry University
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 Nanjing Forestry University filed Critical Nanjing Forestry University
Priority to CN201710612513.1A priority Critical patent/CN107368320B/en
Publication of CN107368320A publication Critical patent/CN107368320A/en
Application granted granted Critical
Publication of CN107368320B publication Critical patent/CN107368320B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4434Reducing the memory space required by the program code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Abstract

The invention discloses a simple early operation data statistical system, which loads all class files required to be executed by a program; creating an object and calling an early operation test method; calling whether a method exists in the persistent storage file through this reference, and receiving the method through a private file field packaged in the early operation test class; calling an early operation data reading persistent storage method through this reference, transmitting a returned File object as a parameter, and receiving through a global variable field map; calling an early operation statistical method through this reference to transmit a returned map set object as a parameter, and receiving through a global variable field map; calling the early operation data of the local type to write in a local persistence method through this reference, and deriving the early operation information of the students of the designated teachers through the method of calling the data in the traversal set through this reference. The invention has the advantages of low memory occupancy rate and convenient operation.

Description

Simple early exercise data statistical system
Technical Field
The invention belongs to the technical field of algorithms, and relates to a simple early exercise data statistical system.
Background
Properties is a property collection object combined with IO stream, Properties can be stored in or loaded from the stream, and each key and its corresponding value in the property list are a string. The Properties object is more applied to the setting of a configuration file in software development, and parameters in the configuration file are all embodied in a character string key value pair mode, so that the values are modified to cover the original values under the condition that the keys are unique, and after persistent storage, the configuration file is reloaded when software is started next time, and the parameters can be visually embodied. The use times of some shared software on the market are limited, and the shared software can also be realized through Properties or configured by using an XML language to describe a custom file and make the description content of the custom file richer, and more specifically, can be read and analyzed by using dom4 j. A plurality of methods are provided in the Properties object to combine the attribute list with the input and output streams so as to complete the operation of the configuration file, and a MESS (multimedia subsystem) early operation data statistical system is simulated and manufactured by combining the characteristics of the Properties.
A list method is provided in the Properties object to output the list of Properties to a specified output stream, which is useful for debugging. The list method is simulated in a design method of a MESS (moving ExercisStatisticsSystemA) early-operation data statistical system, and a method for outputting a set list to a specified stream is provided: ergodicmpapsets. The method provides two parameters, one is a Map set stored locally, when the set is traversed, data information of an early key value in the set can be output to a designated drive through streaming, and as the function is displayed in a GUI graphical interface mode, the data can be finally stored in a file of a local drive in a dialog box path selection mode, so that the streaming is encapsulated and is not exposed to the outside. The second parameter is teacher name, if the teacher name parameter delivers a specific value, the early exercise performance of students of the specific teacher is matched, and if the parameter delivers null, the early exercise personal information and the key value pair information of times of all students are output.
Disclosure of Invention
The invention aims to provide a simple early exercise data statistical system, which solves the problems of complex operation and high memory occupation of the existing early exercise database.
The technical scheme adopted by the invention is carried out according to the following steps:
the method comprises the following steps that 1, a MESS.class file is loaded by a system, and all class files required to be executed by the system are loaded into a memory;
step 2, the main thread enters from the main method of the test class as an entrance, a MorningExercisTest object is created, and an early operation test method MorningExercisOperationTest is called;
step 3, calling whether the persistent storage file has a method fileiSexists or not through this reference, and receiving the persistent storage file in a private file field encapsulated in the early exercise test class;
step 3.1 in the method, a path of a persistent storage File is encapsulated through a File object;
step 3.2, a TreeMap set is created, and as objects are stored in the set, the generic definition is a Student object and a basic data type object packaging class < Student, Integer >, and the generic definition is received through a private field Map < Student, Integer > Map encapsulated in an early exercise test class;
3.3, judging whether the file object in 3.1 exists, if not, directly calling a createNewFile method through the file object to create the file object, and ensuring that the file object exists certainly; creating an ObjectOutputStream, performing serialized storage on the TreeMap set created in 3.2 by a write-object method writeObject, and closing an object output stream in time;
step 3.4, returning File objects which are created and stored with sets;
step 4, calling the early operation data reading persistent storage method through this reference, transmitting the File object returned in the step 3.4 as a parameter, and receiving the File object through a global variable field map;
step 4.1 in the method, associating the object read stream ObjectInputStream with the File object in the parameter transmission;
step 4.2, reading the data which is stored in the local File in a persistent mode into a memory through a readObject of a reading object method;
step 4.3, since the Object type returned by reading the Object by the method is the Object type, and the Map set is stored in the Object serialization, the mandatory type conversion is needed, which is also the process of Object input stream deserialization, and the resource is released to close the stream Object;
step 4.4, returning the map set object after the forced type conversion;
step 5, calling a morning practice statistics method morningExercisStatistics through this reference, transmitting a map set object returned in the step 4.4 as a parameter, and receiving through a global variable field map;
step 5.1, reading personal information data in the student campus card through a card reader, and enabling information of students to be as follows: the name, the gender, the number, the family of the institute, the affiliated teacher, the course project and the course time are used for encapsulating the student object;
step 5.2, taking each student object as a key, and acquiring a value by a get method of a Map set; since only objects are stored in the Map set, the value returned by the get method is received through the Integer object of the basic data type object wrapper class;
step 5.3, recording the number of times of swiping the card by each student by defining the variable count assignment as 0;
step 5.4, judging that if the value returned in step 5.2 is not null, indicating that the student object exists in the Map set and has the embodiment of the corresponding value, taking out the value and assigning the value to a variable count;
step 5.5, each time the student object swipes the card, the card is reflected by the fact that the variable count is added, if the student object exists in the Map set, the corresponding value is taken out and added, then the student object and the value after the adding are stored in the Map set, and if the student object does not exist in the Map set, the values of the student object and the count +1 are directly stored in the Map set;
step 5.6, when the student swipes the card each time, displaying the current times of the students' exercises through a GUI graphical interface, and giving a prompt when the basic qualified times are reached;
step 5.7, because the number of students is uncertain, the tasks of swiping and reading cards are completed by using circulation, and after the circulation is finished, a Map set storing new student information is returned;
step 6, calling the early operation data of the class to be written into a local persistence method through this reference, and simultaneously transmitting the packaged File object and a Map set which is returned from 5.7 and stores the updated student early operation information key value pair as parameters;
step 6.1, packaging the object output stream to enable the object output stream to be associated with a local File packaged by a File object;
6.2 the Map set starts the serialization function of the Map set by realizing a Serializable interface, writes the Map set stored with the student early operation information into a local file by a write object method writeObject of an object output stream, and performs persistent storage;
6.3, releasing resources and closing the stream objects;
step 7, multithreading technology: the main thread creates a new thread in an anonymous internal type form, and manual student data increasing, deleting, modifying and checking are carried out, so that the student information is continuously input, and meanwhile, the information of partial students with problems is increased, deleted, modified and checked;
step 8, exporting the early exercise information of the students of the appointed teacher by calling a method of traversing the data in the set through this reference, transmitting a Map set storing the early exercise information of the students and the name of the appointed teacher as parameters, and exporting the early exercise data information of all the students if the name of the appointed teacher is not available;
step 8.1, packaging the storage position of the exported File into a File object;
step 8.2, packing character output streams by a character stream buffer area to associate File objects in 8.1, so as to achieve the purpose of high-efficiency writing;
and 8.3, acquiring each key in the Map set by circularly and repeatedly reading and writing, matching the teacher name transmitted by the parameters by an equals method of the character string, writing the character string expression form and value of the corresponding student object key into a local file, achieving the effects of persistent storage and reference at any time, and if no parameter of the teacher name is transmitted, deriving all student information and the value of the corresponding early exercise times.
Further, the student object is created as follows:
step 1, designing student classes, encapsulating fields: name, gender, school number, department of the institute, a physical education teacher, a physical education project and a physical education period;
step 2, initializing the construction functions of the empty parameter and the belt parameter;
step 3, defining a set and get method for each field;
step 4, finally, giving a character string expression form to the student class;
step 5, storing the student classes into the TreeMap set, needing default sorting, realizing a compactable interface, covering a compaeto method according to the comparison characteristics of the students, sorting according to the school codes, wherein the school codes are the same, and then sorting according to names;
and 6, enabling the serialization function of the student class by realizing a java.io.Serializable mark interface so as to facilitate the persistent storage and reading and writing of the objects through the ObjectInputStream and the ObjectOutputStream. Further, a method for determining whether the persistent storage file exists comprises the following steps: the method comprises the steps of packaging a File through a File object, judging whether the File exists or not, if the File does not exist, establishing the File through the File object, ensuring that the File exists certainly, and writing a newly-built TreeMap object into the File through an ObjectOutputStream object output stream when the File exists, so that the object read stream can be ensured to smoothly read a Map set object when the File is read, otherwise, throwing EOFException exception when the end of the File or the stream is accidentally reached in the data input process.
Further, the early exercise statistical method is that personal information on a campus card of a student is read through a simulation card reader, each student object is created, the student objects and the early exercise times are stored through a Map set, repeated reading is carried out by using circulation because the number of people entering the personal information is uncertain, when a Graphical User Interface (GUI) is designed, an exit menu is used as an operation for finishing entry, the student objects are used as keys, corresponding values are searched in the set through a get method of a TreeMap set, if the values exist, the number of the early exercise of the student is recorded through a definition variable and then is +1, the Map set is stored again, if the values do not exist, the keys and 1 are directly stored in the Map set, and finally the effects of unique keys and value coverage are achieved.
Furthermore, the method for writing the early operation data into the local persistence is to write the Map set object in the memory into the local through the ObjectOutputStream object output stream, perform the persistence storage, and finally close all the stream resources created and started through the Windows bottom layer.
Furthermore, the multithreading technology is that a data reading and writing function and a data query function are respectively packaged into a single thread, so that the condition that early exercise information of students is continuously input and simultaneously data modification, query and export can be supported by the single thread, the information of the students meeting requirements and the corresponding early exercise times can be exported through traversal, in order to avoid the condition that a null pointer is abnormal when the data is matched, character string constant data is used as a reference for calling an equals method when the equals is compared, if the teacher name parameter is transmitted to a specific value, the early exercise score of the students of a specific teacher is matched, and if the parameter is transmitted to null, the key value pair information of the early exercise personal information and times of all the students is exported.
The invention has the advantages of simple design of the easy-to-operate early-operation data statistical system, low memory occupancy rate, convenient operation and capability of achieving the effect of database design by taking the design characteristics of the configuration file as reference.
Drawings
FIG. 1 is a schematic diagram of an export result from selecting a designated teacher;
fig. 2 is a schematic diagram of the derived result of all teacher lists.
Detailed Description
The present invention will be described in detail with reference to the following embodiments.
And step 1, loading the MESS.
And 2, the main thread enters from the main method of the test class as an entrance, a MorningExercisTest object is created, and an early operation test method (MorningExercisOperationTest) is called.
And step 3, calling whether the persistent storage file has a method (fileiSexists) through this reference, and receiving the private file field encapsulated in the early operation test class.
Step 3.1 in the method, the path of the persistent storage File is encapsulated by a File object.
Step 3.2 creates a TreeMap set, since all objects are stored in the set, the generic definition is Student object and basic data type object wrapping class < Student, Integer >, which is received by the private field Map < Student, Integer > Map encapsulated in early gymnastics test class.
And 3.3, judging whether the file object in the step 3.1 exists, if not, directly calling a createNewFile method through the file object to create the file object, and ensuring that the file object exists certainly. And creating an ObjectOutputStream, storing the TreeMap set created in 3.2 in a serialized mode by a write object method (writeObject), and closing the object output stream in time.
Step 3.4 returns the File object that was created to store the collection.
And 4, calling an early operation data reading persistent storage method (morningExercisDataReadPersistedLocally) by this reference, transmitting the File object returned in the step 3.4 as a parameter, and receiving the File object by the global variable field map.
Step 4.1 in the method, association is performed by establishing an object read stream (ObjectInputStream) and a File object in parameter delivery.
And 4.2, reading the data which is stored in the local File in a persistent mode into the memory through a read object method (readObject).
Step 4.3, since the Object type returned by the Object reading of the method and the Map set stored in the Object serialization, the mandatory type conversion is needed, which is also the process of Object input stream deserialization, and the resource is released to close the stream Object.
Step 4.4 returns the map set object after the mandatory type conversion.
And step 5, calling a gymnastics statistical method (morningExercisstatics) through this reference, transmitting the map set object returned in the step 4.4 as a parameter, and receiving the map set object through the global variable field map.
Step 5.1, reading personal information data in the student campus card through a card reader, and enabling information of students to be as follows: name, gender, number, department of the institute, the affiliated teacher, course project and course time, and packaging the student object.
And 5.2, taking each student object as a key, and acquiring the value by using a get method of a Map set. Since only objects are stored in the Map set, the value returned by the get method is received through the Integer object of the basic data type object wrapper class.
And 5.3, recording the card swiping times of each student by defining the variable count to be assigned to be 0.
And 5.4, judging that if the value returned in 5.2 is not null, indicating that the student object exists in the Map set and has the embodiment of the corresponding value, taking out the value and assigning the value to a variable count, wherein the basic data type and the object cannot be directly operated, so that the JDK is upgraded to 1.5, more convenient implicit conversion of the object and the basic data type is provided, and an automatic unpacking and automatic packing mechanism is provided, so that the operation is ensured to be executed.
Step 5.5, each time the student object swipes the card, the corresponding value is taken out and added once if the student object exists in the Map set, and then the student object and the value after the adding are stored in the Map set. Meanwhile, the method can also realize the default ordering of the elements in the TreeMap set. And as the student's school number is unique, the main condition in the comparison method is the student's school number. Therefore, the achievement is shown in ascending order of the school number when being exported. If the student object does not exist in the set, the values of the student object and count +1 (i.e., 1) are directly stored in the Map set. The method realizes the effects of the same object key and value coverage of students and achieves the aim of accurately recording the number of times of students' exercises.
And 5.6, displaying the current times of the students for taking exercises through a Graphical User Interface (GUI) when the students swipe cards every time, and giving a prompt to the students when the basic times of the students for taking exercises reach the basic times of the students for having a plurality of hearts.
And 5.7, because the number of students is uncertain, the tasks of swiping the card and reading the card are completed by using circulation. After the circulation is finished, the Map set storing new student information is returned.
And 6, calling a method (morningExercisDataWritePerserstristeedLocally) for writing the early operation data of the class into the local persistence through this reference, and simultaneously transmitting the packaged File object and a Map set which is returned in 5.7 and stores the updated student early operation information key value pair as parameters.
And 6.1, packaging the object output stream to be associated with the local File packaged by the File object.
Step 6.2 enables its serialization functionality by implementing the Serializable interface due to the Map set. And writing the Map set stored with the early operation information of the students into a local file through a write object method (writeObject) of the object output stream, performing persistent storage, and facilitating reading and calling again and updating data.
And 6.3, releasing the resources and closing the stream object.
And 7, creating a new thread by the main thread in an anonymous internal class form, and manually increasing, deleting, modifying and checking the student data. So as to ensure that the information of students with partial problems is added, deleted, changed and checked while the information of students is continuously input.
And 8, calling a method for traversing data in the set by this reference, and exporting the early exercise information of the students of the designated teacher. And transmitting the Map set storing the early exercise information of the students and the name of the designated teacher as parameters. If no teacher name is specified, all student early exercise data information is derived.
Step 8.1 encapsulates the location where the export File is stored into a File object.
And 8.2, packing character output streams by the character stream buffer area to associate File objects in 8.1, so as to achieve the purpose of high-efficiency writing.
And 8.3, obtaining each key in the Map set, namely the student object, by circularly and repeatedly reading and writing, matching the teacher name transmitted by the parameter by using the equals method of the character string, and writing the character string expression form and value of the corresponding student object key into a local file, so that the effects of persistent storage and reference at any time are achieved. If no parameter for the teacher's name is passed see FIG. 2, then all student information and values corresponding to the number of morning exercises will be derived.
Designing students:
the design of the student class is convenient for creating student objects. Different information of students is subjected to class description and encapsulation, and initialization of objects is carried out through a specified constructor, so that the objects are called through the objects, the objects are instructed to do things, and the object-oriented characteristic of Java is fully embodied. In the invention, the information of students (name, gender, school number, family, physical lesson teacher, physical lesson project, physical lesson time period) is packaged into objects so as to be conveniently stored in the Map set, because the objects can only be stored in the set. Meanwhile, the object can be conveniently and timely taken out from the Map set for further operation, for example, after the student object is taken out, the setting and acquisition of the student object member fields can be carried out through set and get methods, and the information of each student can be obtained. The design of the student class is mainly embodied in step 5, namely the creation of the student objects and the storage and the extraction of the student objects in the collection are carried out through the description of the student class.
Step 1, designing student class, and packaging fields (name, gender, school number, department, physical education teacher, physical education project, physical education time period)
Step 2, carrying out the initialization of the empty parameter and the constructor with parameters
Step 3, defining set and get method for each field
And 4, finally, giving a character string expression form for the student class.
And 5, storing the student classes into the TreeMap set, needing default sorting, realizing a compactable interface, covering a compato method according to the comparison characteristics of the students, sorting according to the academic numbers, wherein the academic numbers are the same, and then sorting according to names.
And 6, enabling the serialization function of the student class by realizing a java.io.Serializable mark interface so as to facilitate the persistent storage and reading and writing of the objects through the ObjectInputStream and the ObjectOutputStream.
Early exercise implementation design:
the design of the early exercise implementation class is to describe and package each method required to be called in the steps of the invention, mainly package the methods into four relatively independent methods, package a plurality of methods, establish a specific method suitable for the invention, improve the readability and facilitate the internal calling of the user.
1. The method for judging whether the persistent storage file exists comprises the following steps: the File does not exist when the program runs for the first time, the File is packaged through the File object, whether the File exists or not is judged, if the File does not exist, the File is ensured to exist certainly, and when the File exists, a newly-built TreeMap object is written into the File through an ObjectOutputStream object output stream, so that the object read stream can be ensured to read the Map set object smoothly when reading the File. Otherwise, when the end of the file or stream is accidentally reached during data entry, the EOFException exception is thrown.
2. The early exercise statistical method comprises the following steps: each student object is created by reading personal information on the student campus card through an analog card reader. An Object read by ObjectInputStream is received in objection, so it is to be converted to a Map set by forced conversion. The Map set is used for storing student objects and the times of early exercises, and the TreeMap set is used because the student objects have the order of numbers for future searching. Since the number of persons who enter personal information is uncertain, repeated reading is performed using a loop, and the exit menu is an operation for ending entry when the GUI graphical interface is designed. And (3) the student object is used as a key, a corresponding value is searched in the set through a get method of the TreeMap set, if the value exists, the number of times of the student performing early operations is recorded through a definition variable and then is stored in the Map set again, and if the value does not exist, the key and the value 1 are directly stored in the Map set, so that the effects of unique key and value coverage are finally achieved. Therefore, the accumulation of the attendance times of the early exercises is ensured. Since the school number is unique, the keys are all unique. The operation between the basic data type and the basic data type object packaging class is realized by the characteristics of automatic unpacking and automatic packing.
3. The method for writing early operation data into local persistence comprises the following steps: and writing the Map set object in the memory into the local through an ObjectOutputStream object output stream, performing persistent storage, and finally closing all stream resources created and started through a Windows bottom layer.
4. Multithreading: the data reading and writing function and the data query function are respectively packaged into a single thread, so that the data can be modified, queried and exported by an independent thread while the early exercise information of the students is continuously input, and the required information of the students and the corresponding early exercise times can be exported by traversing, for example, the early exercise scores of the students corresponding to teachers are matched. In order to avoid the condition of null pointer exception when matching data, string constant data is used as a reference for calling the equals method when comparing through the equals. If the teacher name parameter delivers a specific value, the early exercise performance of the students of the specific teacher is matched, and if the parameter delivers null, the key value pair information of the early exercise personal information and times of all the students is derived. The data export can be realized by adding the character output stream in the method. The file is finally stored locally, namely the drive letter of the software is located, so that the resource can be conveniently searched and closed.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not intended to limit the present invention in any way, and all simple modifications, equivalent variations and modifications made to the above embodiments according to the technical spirit of the present invention are within the scope of the present invention.

Claims (6)

1. A simple early exercise data statistical system is characterized by comprising the following steps:
the method comprises the following steps that 1, a MESS.class file is loaded by a system, and all class files required to be executed by the system are loaded into a memory;
step 2, the main thread enters from the main method of the test class as an entrance, a MorningExercisTest object is created, and an early operation test method MorningExercisOperationTest is called;
step 3, calling whether the persistent storage file has a method fileiSexists or not through this reference, and receiving the persistent storage file in a private file field encapsulated in the early exercise test class;
step 3.1 in the method, a path of a persistent storage File is encapsulated through a File object;
step 3.2, a TreeMap set is created, and as objects are stored in the set, the generic definition is a Student object and a basic data type object packaging class < Student, Integer >, and the generic definition is received through a private field Map < Student, Integer > Map encapsulated in an early exercise test class;
3.3, judging whether the file object in 3.1 exists, if not, directly calling a createNewFile method through the file object to create the file object, and ensuring that the file object exists certainly; creating an ObjectOutputStream, performing serialized storage on the TreeMap set created in 3.2 by a write-object method writeObject, and closing an object output stream in time;
step 3.4, returning File objects which are created and stored with sets;
step 4, calling the early operation data reading persistent storage method through this reference, transmitting the File object returned in the step 3.4 as a parameter, and receiving the File object through a global variable field map;
step 4.1 in the method, associating the object read stream ObjectInputStream with the File object in the parameter transmission;
step 4.2, reading the data which is stored in the local File in a persistent mode into a memory through a readObject of a reading object method;
step 4.3, since the Object type returned by reading the Object by the method is the Object type, and the Map set is stored in the Object serialization, the mandatory type conversion is needed, which is also the process of Object input stream deserialization, and the resource is released to close the stream Object;
step 4.4, returning the map set object after the forced type conversion;
step 5, calling a morning practice statistics method morningExercisStatistics through this reference, transmitting a map set object returned in the step 4.4 as a parameter, and receiving through a global variable field map;
step 5.1, reading personal information data in the student campus card through a card reader, and enabling information of students to be as follows: the name, the gender, the number, the family of the institute, the affiliated teacher, the course project and the course time are used for encapsulating the student object; step 5.2, taking each student object as a key, and acquiring a value by a get method of a Map set; since only objects are stored in the Map set, the value returned by the get method is received through the Integer object of the basic data type object wrapper class;
step 5.3, recording the number of times of swiping the card by each student by defining the variable count assignment as 0;
step 5.4, judging that if the value returned in step 5.2 is not null, indicating that the student object exists in the Map set and has the embodiment of the corresponding value, taking out the value and assigning the value to a variable count;
step 5.5, each time the student object swipes the card, the card is reflected by the fact that the variable count is added, if the student object exists in the Map set, the corresponding value is taken out and added, then the student object and the value after the adding are stored in the Map set, and if the student object does not exist in the Map set, the values of the student object and the count +1 are directly stored in the Map set;
step 5.6, when the student swipes the card each time, displaying the current times of the students' exercises through a GUI graphical interface, and giving a prompt when the basic qualified times are reached;
step 5.7, because the number of students is uncertain, the tasks of swiping and reading cards are completed by using circulation, and after the circulation is finished, a Map set storing new student information is returned;
step 6, calling the early operation data of the class to be written into a local persistence method through this reference, and simultaneously transmitting the packaged File object and a Map set which is returned from 5.7 and stores the updated student early operation information key value pair as parameters;
step 6.1, packaging the object output stream to enable the object output stream to be associated with a local File packaged by a File object;
6.2 the Map set starts the serialization function of the Map set by realizing a Serializable interface, writes the Map set stored with the student early operation information into a local file by a write object method writeObject of an object output stream, and performs persistent storage;
6.3, releasing resources and closing the stream objects;
step 7, multithreading technology: the main thread creates a new thread in an anonymous internal type form, and manual student data increasing, deleting, modifying and checking are carried out, so that the student information is continuously input, and meanwhile, the information of partial students with problems is increased, deleted, modified and checked;
step 8, exporting the early exercise information of the students of the appointed teacher by calling a method of traversing the data in the set through this reference, transmitting a Map set storing the early exercise information of the students and the name of the appointed teacher as parameters, and exporting the early exercise data information of all the students if the name of the appointed teacher is not available;
step 8.1, packaging the storage position of the exported File into a File object;
step 8.2, packing character output streams by a character stream buffer area to associate File objects in 8.1, so as to achieve the purpose of high-efficiency writing;
and 8.3, acquiring each key in the Map set by circularly and repeatedly reading and writing, matching the teacher name transmitted by the parameters by an equals method of the character string, writing the character string expression form and value of the corresponding student object key into a local file, achieving the effects of persistent storage and reference at any time, and if no parameter of the teacher name is transmitted, deriving all student information and the value of the corresponding early exercise times.
2. A simple morning exercise data statistics system as claimed in claim 1, wherein: the student object creating steps are as follows:
step 1, designing student classes, encapsulating fields: name, gender, school number, department of the institute, a physical education teacher, a physical education project and a physical education period;
step 2, initializing the construction functions of the empty parameter and the belt parameter;
step 3, defining a set and get method for each field;
step 4, finally, giving a character string expression form to the student class;
step 5, storing the student classes into the TreeMap set, needing default sorting, realizing a compactable interface, covering a compaeto method according to the comparison characteristics of the students, sorting according to the school codes, wherein the school codes are the same, and then sorting according to names;
and 6, enabling the serialization function of the student class by realizing a java.io.Serializable mark interface so as to facilitate the persistent storage and reading and writing of the objects through the ObjectInputStream and the ObjectOutputStream.
3. A simple morning exercise data statistics system as claimed in claim 1, wherein: the method for judging whether the persistent storage file exists comprises the following steps: the method comprises the steps of packaging a File through a File object, judging whether the File exists or not, if the File does not exist, establishing the File through the File object, ensuring that the File exists certainly, and writing a newly-built TreeMap object into the File through an ObjectOutputStream object output stream when the File exists, so that the object read stream can be ensured to smoothly read a Map set object when the File is read, otherwise, throwing EOFException exception when the end of the File or the stream is accidentally reached in the data input process.
4. A simple morning exercise data statistics system as claimed in claim 1, wherein: the early exercise statistical method includes reading personal information on a student campus card through a simulation card reader, creating each student object, storing the student objects and early exercise times through a Map set, repeatedly reading the personal information in a circulating mode due to the fact that the number of people entering the personal information is uncertain, taking an exit menu as an operation of ending entry when a Graphical User Interface (GUI) is designed, searching corresponding values in the set by taking the student objects as keys through a get method of a TreeMap set, recording the number of the early exercise times of students through a definition variable and then storing the values into the Map set again, and directly storing the keys and the values into the Map set if the values do not exist, so that the effects of unique keys and value coverage are achieved.
5. A simple morning exercise data statistics system as claimed in claim 1, wherein: the method for writing the early operation data into the local persistence is to write the Map set object in the memory into the local through the ObjectOutputStream object output stream, perform the persistence storage, and finally close all the stream resources created and started through the Windows bottom layer.
6. A simple morning exercise data statistics system as claimed in claim 1, wherein: the multithreading technology is characterized in that a data reading and writing function and a data query function are respectively packaged into a single thread, the fact that the early exercise information of students is continuously input is guaranteed, meanwhile, an independent thread can support data modification, query and export, the information of the students meeting requirements and the corresponding early exercise times can be exported through traversal, in order to avoid the condition that a null pointer is abnormal when the data is matched, character string constant data is used as a reference for calling an equals method when equals are compared, if the teacher name parameter is transmitted to be a specific value, the early exercise scores of the students of a specific teacher are matched, and if the parameter is transmitted to be null, the key value pair information values of the early exercise personal information and the times of all the students are exported.
CN201710612513.1A 2017-07-25 2017-07-25 Simple early exercise data statistical system Expired - Fee Related CN107368320B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710612513.1A CN107368320B (en) 2017-07-25 2017-07-25 Simple early exercise data statistical system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710612513.1A CN107368320B (en) 2017-07-25 2017-07-25 Simple early exercise data statistical system

Publications (2)

Publication Number Publication Date
CN107368320A CN107368320A (en) 2017-11-21
CN107368320B true CN107368320B (en) 2020-06-26

Family

ID=60308584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710612513.1A Expired - Fee Related CN107368320B (en) 2017-07-25 2017-07-25 Simple early exercise data statistical system

Country Status (1)

Country Link
CN (1) CN107368320B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109376154B (en) * 2018-10-26 2020-11-10 杭州玳数科技有限公司 Data reading and writing method and data reading and writing system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778057A (en) * 2009-12-30 2010-07-14 东南大学 Method for achieving mail system based on converged communication
CN101996071A (en) * 2009-08-20 2011-03-30 上海杉达学院 Software architecture of information control system and architecting method
CN204066147U (en) * 2014-08-11 2014-12-31 湖北工业大学 A kind of electronic attendance based on near-field communication and planar bar code technology and inquiry system
CN105787128A (en) * 2016-03-29 2016-07-20 四川秘无痕信息安全技术有限责任公司 Method for recovering Java serialized file data
CN106406972A (en) * 2016-11-04 2017-02-15 珠海市杰理科技股份有限公司 Program compiling method and compiler

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8392890B2 (en) * 2007-10-15 2013-03-05 Software Research, Inc. Method and system for testing websites

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101996071A (en) * 2009-08-20 2011-03-30 上海杉达学院 Software architecture of information control system and architecting method
CN101778057A (en) * 2009-12-30 2010-07-14 东南大学 Method for achieving mail system based on converged communication
CN204066147U (en) * 2014-08-11 2014-12-31 湖北工业大学 A kind of electronic attendance based on near-field communication and planar bar code technology and inquiry system
CN105787128A (en) * 2016-03-29 2016-07-20 四川秘无痕信息安全技术有限责任公司 Method for recovering Java serialized file data
CN106406972A (en) * 2016-11-04 2017-02-15 珠海市杰理科技股份有限公司 Program compiling method and compiler

Also Published As

Publication number Publication date
CN107368320A (en) 2017-11-21

Similar Documents

Publication Publication Date Title
US20140310619A1 (en) Signal capture controls in recalculation user interface
WO2020228283A1 (en) Feature extraction method and apparatus, and computer readable storage medium
CN109918370A (en) A kind of development approach and system of the configurable forms application front end based on WEB
US20170186337A1 (en) Programming learning center
CN108829389A (en) Android application automation triggering execution method based on Appium
CN106874208A (en) The processing method of test script, device and electronic equipment
CN107368320B (en) Simple early exercise data statistical system
CN113672520A (en) Test case generation method and device, electronic equipment and storage medium
CN105242958B (en) A kind of dummy experiment system exchanges method with HLA simulation system data
CN109815126A (en) Method for testing software, device, computer equipment and storage medium
CN105930584B (en) A kind of Virtual Experiment Platform Based and its implementation of computer composition and system structure
US11681511B2 (en) Systems and methods for building and deploying machine learning applications
CN110175022A (en) Automatically generate the method, apparatus and storage medium, computer equipment of POJO class
CN112069080A (en) Automatic executable script test method and system
EP0333619A2 (en) Panel definition language for computer display
Sarcar Interactive Object-Oriented Programming in Java: Learn and Test Your Programming Skills
CN115981711B (en) Code processing method and electronic equipment
Pulido Gil Benchmark for machine learning frameworks and libraries on iOS
KR102514361B1 (en) Method, apparatus and system for determining textbook providing psychological test of subject through sticker attachment and performing psychological test using the same
Kim et al. Adapting higher-order list operators for blocks programming
Huang et al. Generative Approach to the Automation of Artificial Intelligence Applications
Sarcar Interactive Object Oriented Programming in Java
Heimlich Pictures to objects: transitioning to object oriented programming
Punch et al. Practice of Computing Using Python, The
Sharma et al. IPM Product Testing With IPM

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200626

Termination date: 20210725

CF01 Termination of patent right due to non-payment of annual fee