CN115237415A - Method for realizing situation duplication under GIS platform - Google Patents

Method for realizing situation duplication under GIS platform Download PDF

Info

Publication number
CN115237415A
CN115237415A CN202211156172.9A CN202211156172A CN115237415A CN 115237415 A CN115237415 A CN 115237415A CN 202211156172 A CN202211156172 A CN 202211156172A CN 115237415 A CN115237415 A CN 115237415A
Authority
CN
China
Prior art keywords
data type
data
json character
scene information
conversion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211156172.9A
Other languages
Chinese (zh)
Other versions
CN115237415B (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 Thunderbolt Information Technology Co ltd
Original Assignee
Nanjing Leading Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Leading Information Technology Co ltd filed Critical Nanjing Leading Information Technology Co ltd
Priority to CN202211156172.9A priority Critical patent/CN115237415B/en
Publication of CN115237415A publication Critical patent/CN115237415A/en
Application granted granted Critical
Publication of CN115237415B publication Critical patent/CN115237415B/en
Active 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/40Transformation of program code

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for realizing situation duplication under a GIS platform, which comprises the steps of defining a function template, and specializing the function template aiming at a built-in data type of a C + + standard and a commonly used data type under a development background; defining two macros which can serialize and deserialize any data type instance and JSON character strings, so that a developer can use the two macros to perform data conversion only paying attention to parameter contents in the data type regardless of the parameter type; the scene information generator takes each data refreshing cycle as a time unit, creates a corresponding scene information data type object, uses a conversion function to serialize the scene information data type object to generate a JSON character string, and performs data storage and data record generation; reading JSON character string records during the control of the compound disk; and the situation display renderer deserializes and restores the JSON character strings into scene information data type objects by using a conversion function, so that situation display is realized.

Description

Method for realizing situation duplication under GIS platform
Technical Field
The invention relates to an electronic information technology, in particular to a method for realizing a situation copy under a GIS platform.
Background
In the existing software development, if a rich interface effect is required, a design scheme of separating data from display is generally adopted, and particularly situation software, especially situation software developed based on a GIS platform, has the requirement of frequently needing to be displayed in a copy mode besides normal real-time data generation promotion.
For the multi-disc function, besides direct data recording and reading, sub-functions such as high speed, low speed, progress jump and the like are involved, and a powerful data storage mechanism is necessary to realize the functions, such as:
(1) From the perspective of saving storage space, the storage change data is saved most, but the data retrieval is required to be added during the jump to ensure that all information of the current situation can be loaded at any time point of the jump, so that additional development work is obviously added, the data reading time is prolonged, and the burden is also caused on the flexibility of secondary processing of data storage;
(2) From the viewpoint of data storage format, in order to save storage space and shorten parsing time, a hexadecimal data storage format with a fixed frame length and a fixed structure is usually most suitable, but in the actual situation, due to the influence of business requirements, during development, even after software delivery, the data content is still likely to have a modification requirement, which affects the compatibility and stability of software.
For the above two problems, the prior art solutions usually solve the above two problems by saving the complete situation at regular time, so that the situation can be completely restored when reading from any record; however, as described above, this method requires a fixed field structure to be designed for storage, and cannot expand a program.
In summary, the conventional development method is tested by both the storage method and the storage format when the multi-disk requirement is met and the service requirement is not clear.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to solve the defects in the prior art, and provides a method for realizing situation copy under a GIS platform, which can provide a scheme mechanism with simple storage and convenient expansion aiming at the disadvantages of poor data storage compatibility, complex data reading and retrieving work, influence on version compatibility due to data structure change caused by service change and the like of the traditional scheme under the condition of copy requirements and variable service requirements.
The technical scheme is as follows: the invention relates to a method for realizing a situation reply under a GIS platform, which comprises the following steps:
step (1), defining a function template capable of mutually converting any data type and JSON character strings, and specializing the function template according to a built-in data type of a C + + standard and a commonly used data type (such as QString, qvector and the like) in a development background;
step (2), defining two macros which can serialize and deserialize any data type instance and JSON character strings, so that a developer can use the two macros to perform data conversion regardless of the parameter type and only pay attention to the parameter content in the data type;
designing a corresponding data type representing scene information, wherein the data type comprises a class and a structural body;
step (4), defining and obtaining a conversion function between the scene information data type and the JSON character string by using the macro in the step (2); specifically, the macro in the step (2) is used as a function statement for the scene information data type, the template function in the step (1) is called for all members of the scene information data type in the function body respectively to obtain the definition of a conversion function, and the function can complete the interconversion between the scene information data type and the JSON character string;
step (5), the scene information generator creates a corresponding scene information data type object by taking each data refresh period (for example, 1 second) as a time unit, serializes the object to generate a JSON character string by using the function defined in the step (4), stores the JSON character string in data and generates a data record;
step (6), reading the stored JSON character string record according to time points during the multi-disk control; here the point in time is determined by the actual situation,
and (7) the situation display renderer deserializes and restores the JSON character strings into scene information data type objects by using the conversion functions defined in the step (4), and rendering control is performed on a display layer to realize situation display.
Further, the step (2) carries out serialization and deserialization conversion between any data type instance and the JSON character string through two macros; the user-defined data type is mainly a user-defined type or a structural body, wherein one macro carries out an integral encapsulation function, and the user-defined data type is determined to be serialized or deserialized according to parameters; the other macro calls a function template in a text replacement mode to complete the conversion between the member variables of the user-defined data type object and the JSON character strings; the developer uses the two macros in combination to complete conversion definition of the custom data type and the JSON character string, and data conversion which only focuses on the variable content of the member of the data type object and does not depend on the variable type of the member is carried out.
Has the beneficial effects that: the invention can be used for situation display under a GIS platform, and has a high-efficiency and flexible data exchange mode (suitable for C + + language). The method can be used for updating the parameters in real time, is also suitable for scene replication allowing the user to perform progress control after storage, and has strong applicability. In comparison with the prior art, the method specifically comprises the following advantages,
1) By utilizing the technical modes of macro definition, templates and the like, a uniform conversion function capable of serializing and deserializing various custom types (including built-in data types) and JSON character strings is realized;
2) For the data generation module, the object of the scene information data type generated in each time unit is converted into a JSON character string for storage or directly forwarded.
3) For the rendering module, the JSON character strings which are received in butt joint need to be analyzed and reduced into scene information data type objects, and situation display is achieved according to object parameters.
Drawings
FIG. 1 is a diagram of the overall strategy architecture of the present invention;
FIG. 2 is an overall policy flow diagram of the present invention;
FIG. 3 is a diagram illustrating a debugging effect of rapidly converting a scene information data type object into JSON in an embodiment;
FIG. 4 is a diagram of the rapid deserialization debugging effect of the JSON character string in the embodiment;
FIG. 5 is a diagram illustrating interface effects rendered according to scene information data type objects in an embodiment.
Detailed Description
The technical solution of the present invention is described in detail below, but the scope of the present invention is not limited to the embodiments.
As shown in fig. 1 and fig. 2, the method for implementing a situation copy under a GIS platform of this embodiment includes the following steps:
step (1), defining a function template capable of mutually converting any data type and JSON character strings, and specializing the function template according to a built-in data type of a C + + standard and a commonly used data type (such as QString, qvector and the like) in a development background;
step (2), two macros which can carry out serialization and deserialization between any data type instance and the JSON character string are defined, so that a developer can use the two macros to carry out data conversion only paying attention to parameter contents in the data type regardless of the parameter type; the user-defined data type is mainly a user-defined type or a structural body, wherein one macro carries out an integral encapsulation function, and the user-defined data type is determined to be serialized or deserialized according to parameters; the other macro calls a function template through a text replacement mode to complete conversion between the user-defined data type object member variables and JSON character strings;
the developer uses the two macros in a combined mode to complete conversion definition of a custom data type and a JSON character string, and data conversion which only concerns the member variable content of the data type object and does not consider the member variable type is carried out;
designing corresponding data types representing scene information, wherein the data types comprise classes (such as data types of a design scene snapshot class, a navigation device class, a satellite class, an interference device class and the like) and a structural body;
step (4), defining and obtaining a conversion function between the scene information data type and the JSON character string by using the macro in the step (2);
step (5), the scene information generator creates a corresponding scene information data type object by taking each data refreshing period (for example, 1 second) as a time unit, serializes the object to generate a JSON character string by using the function defined in the step (4), stores the JSON character string in data and generates a data record;
step (6), reading the stored JSON character string record according to time points during the multi-disk control;
and (7) the situation display renderer deserializes and restores the JSON character strings into scene information data type objects by using the conversion functions defined in the step (4), and rendering control is performed on a display layer to realize situation display.
The invention is simple and convenient to use, and is convenient for developers to concentrate on the service rather than data conversion; meanwhile, the data storage and retrieval are simpler; the data format for interaction has strong robustness, flexibility and expandability, and even if the requirements are changed at different stages of a project, the parameter content or the organization mode of the scene information data type is changed, and the development and deployment work is minimally influenced.
Example 1:
in this embodiment, taking performance evaluation software of a navigation device as an example, the initial functions of the performance evaluation software of the navigation device include:
taking a single navigation device as a core;
devices that can affect their performance are: an interference device;
factors that can affect its efficacy are: the distance between the satellite, the interference device and the navigation equipment, the included angle between the transmitting signal and the direction of the receiving antenna and the like;
and setting an experiment parameter script by a user, automatically executing the script after specifying the information parameters of the device, updating scene information according to time change, rendering the situation, automatically recording process data and supporting playback.
Next, taking the Qt platform as an example for demonstration, as shown in fig. 3 and 5, the method for implementing a situation replication under a GIS platform includes the following steps:
step 1, defining function template
This embodiment defines a function template, and converts any data type and JSON character string into each other through the function template, for example, saveToJsonObject, loadFromJsonObject. And specializing the built-in type of the C + + standard and common data types used in development in a Qt framework, such as QString, qvector and the like, based on the function template.
Step 2, defining macro capable of converting custom data type and JSON character string
Two macros are defined, and any data type instance and JSON character string can be converted into a serialization mode and an deserialization mode. The user-defined data type is mainly a user-defined type or a structure body, and one macro is responsible for an integral encapsulation function and determines to carry out serialization or deserialization on the user-defined data type according to parameters; and the other macro is responsible for calling the function template in a text replacement mode to finish the conversion between the member variables of the custom data type object and the JSON character strings.
The developer can complete the conversion definition of the custom data type and the JSON character string by using the two macros in a combined mode, and data conversion which only concerns the member variable content of the data type object and does not consider the member variable type is carried out.
Step 3, designing various data types representing scene information
And designing data types such as scene snapshot types, navigation equipment types, satellite types, interference equipment types and the like according to software requirements. The design scene snapshot class comprises member variables of types such as a navigation device class, a satellite class and an interference device class.
Step 4, defining a conversion function between the scene information data type and the JSON character string
And defining a conversion method from self-defined data types such as scene snapshot types, navigation equipment types, satellite types, interference equipment types and the like to JSON character strings by using the existing macro to obtain a serialization/deserialization conversion function.
Step 5, the scene information generator starts to work
The scene information generator starts to work, generates an object of a scene snapshot class every second, serializes the object by using a conversion function to generate a JSON character string, and stores the JSON character string.
Step 6, reading record during disc duplication
When the disk is copied, the stored JSON character string record is read according to the time point.
Step 7, deserializing JSON character strings and displaying situation
And after receiving the JSON character string, the situation display renderer performs deserialization reduction on the JSON character string by using a conversion function to obtain a scene snapshot object, and performs rendering control on a display layer according to the member variable value of the scene snapshot object to realize situation display.
The following examples were conducted to analyze the effects of the above embodiments
Because the function template and the macro definition are used and the uniform conversion function interface is encapsulated, the serialization and the deserialization become very simple and convenient for different user-defined types and are consistent with the member variable statement of the user-defined type;
as the JSON form data of the scene snapshot class is stored, the data at a specific time can be directly positioned in a copy scene without more data retrieval, and the storage and secondary processing of the data are simpler;
when the service changes, for example, signal enhancement equipment needs to be added, only corresponding class definitions need to be added, and corresponding members need to be added in the scene snapshot class. As the scene snapshot class used for interaction is encapsulated into JSON character strings, the basic syntax format of the scene snapshot class is not changed, the scene snapshot class is completely compatible with the previous version, and remarkable robustness and expandability are realized.

Claims (2)

1. A method for realizing situation duplication under a GIS platform is characterized by comprising the following steps: the method comprises the following steps:
defining a function template capable of mutually converting any data type and JSON character strings, and specializing the function template aiming at built-in data types of the C + + standard and commonly used data types under the development background; the common data types comprise Qstring and Qvector;
step (2), defining two macros which can serialize and deserialize any data type instance and JSON character strings, so that a developer can use the two macros to perform data conversion regardless of the parameter type and only pay attention to the parameter content in the data type;
designing a corresponding data type representing scene information, wherein the data type comprises a class and a structural body;
step (4), defining and obtaining a conversion function between the scene information data type and the JSON character string by using the macro in the step (2);
step (5), the scene information generator creates a corresponding scene information data type object by taking each data refreshing cycle as a time unit, serializes the scene information data type object by using the conversion function obtained in the step (4) to generate a JSON character string, stores the JSON character string in data and generates a data record;
step (6), reading the stored JSON character string record according to time points during the copy control;
and (7) the situation display renderer deserializes and restores the JSON character strings into scene information data type objects by using the conversion functions defined in the step (4), and rendering control is performed on a display layer to realize situation display.
2. The method for realizing the situation reply under the GIS platform according to claim 1, characterized in that: the step (2) carries out serialization and deserialization conversion between any data type instance and the JSON character string through two macros; one macro performs an integral encapsulation function, and determines to perform serialization or deserialization on the custom data type according to the parameters; the other macro calls a function template through a text replacement mode to complete conversion between the user-defined data type object member variables and JSON character strings;
the developer uses the two macros in combination to complete conversion definition of the custom data type and the JSON character string, and data conversion which only concerns the member variable content of the data type object and does not depend on the member variable type is carried out.
CN202211156172.9A 2022-09-22 2022-09-22 Method for realizing situation duplication under GIS platform Active CN115237415B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211156172.9A CN115237415B (en) 2022-09-22 2022-09-22 Method for realizing situation duplication under GIS platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211156172.9A CN115237415B (en) 2022-09-22 2022-09-22 Method for realizing situation duplication under GIS platform

Publications (2)

Publication Number Publication Date
CN115237415A true CN115237415A (en) 2022-10-25
CN115237415B CN115237415B (en) 2022-12-16

Family

ID=83667314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211156172.9A Active CN115237415B (en) 2022-09-22 2022-09-22 Method for realizing situation duplication under GIS platform

Country Status (1)

Country Link
CN (1) CN115237415B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116737135A (en) * 2023-06-25 2023-09-12 上海同星智能科技有限公司 Parameter configuration method and system for graphic program

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105573956A (en) * 2015-12-10 2016-05-11 盛趣信息技术(上海)有限公司 Serialization method and serialization-based network communication method
US20170315791A1 (en) * 2016-04-29 2017-11-02 Intuit Inc. Method and system for developing and deploying data science transformations from a development computing environment into a production computing environment
CN113138755A (en) * 2021-04-19 2021-07-20 上海逸动医学科技有限公司 JSON serialization and deserialization optimization method and system
CN113990111A (en) * 2021-10-20 2022-01-28 成都民航空管科技发展有限公司 Multi-data-source-based control operation situation double-disk analysis method and system
CN114095340A (en) * 2022-01-20 2022-02-25 湖南泛联新安信息科技有限公司 Virtual-real combined network shooting range scene and snapshot construction method
CN114117992A (en) * 2021-11-25 2022-03-01 北京力控元通科技有限公司 Serialization and deserialization method and device and electronic equipment
CN114780624A (en) * 2022-03-30 2022-07-22 中国人民武装警察部队工程大学 Data acquisition marking and task replication deduction technology based on time sequence and application method
CN114968623A (en) * 2022-05-31 2022-08-30 中通服咨询设计研究院有限公司 Real-time equipment operation situation sensing system based on GIS map and object model

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105573956A (en) * 2015-12-10 2016-05-11 盛趣信息技术(上海)有限公司 Serialization method and serialization-based network communication method
US20170315791A1 (en) * 2016-04-29 2017-11-02 Intuit Inc. Method and system for developing and deploying data science transformations from a development computing environment into a production computing environment
CN113138755A (en) * 2021-04-19 2021-07-20 上海逸动医学科技有限公司 JSON serialization and deserialization optimization method and system
CN113990111A (en) * 2021-10-20 2022-01-28 成都民航空管科技发展有限公司 Multi-data-source-based control operation situation double-disk analysis method and system
CN114117992A (en) * 2021-11-25 2022-03-01 北京力控元通科技有限公司 Serialization and deserialization method and device and electronic equipment
CN114095340A (en) * 2022-01-20 2022-02-25 湖南泛联新安信息科技有限公司 Virtual-real combined network shooting range scene and snapshot construction method
CN114780624A (en) * 2022-03-30 2022-07-22 中国人民武装警察部队工程大学 Data acquisition marking and task replication deduction technology based on time sequence and application method
CN114968623A (en) * 2022-05-31 2022-08-30 中通服咨询设计研究院有限公司 Real-time equipment operation situation sensing system based on GIS map and object model

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
RYAN PEARSON 等: ""Generic application driven situation awareness via ontological situation recognition"", 《2016 IEEE INTERNATIONAL MULTI-DISCIPLINARY CONFERENCE ON COGNITIVE METHODS IN SITUATION AWARENESS AND DECISION SUPPORT (COGSIMA)》 *
梁白鸥: ""一种提高代码复用的C++序列化框架设计"", 《单片机与嵌入式系统应用》 *
王永利 等: ""态势认知总体框架及其关键技术"", 《指挥信息系统与技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116737135A (en) * 2023-06-25 2023-09-12 上海同星智能科技有限公司 Parameter configuration method and system for graphic program
CN116737135B (en) * 2023-06-25 2024-01-30 上海同星智能科技有限公司 Parameter configuration method and system for graphic program

Also Published As

Publication number Publication date
CN115237415B (en) 2022-12-16

Similar Documents

Publication Publication Date Title
EP2359247B1 (en) Transforming user script code for debugging
US11694299B2 (en) Methods and apparatus to emulate graphics processing unit instructions
US9817857B2 (en) Deep cloning of objects using binary format
CN101996131A (en) Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word
JP2010517134A (en) Heterogeneous program linkage method and its middleware platform engine
CN102480467B (en) A kind of SOC software and hardware cooperating simulation verification method of communications protocol Network Based
CN115237415B (en) Method for realizing situation duplication under GIS platform
CN116974620A (en) Application program generation method, operation method and corresponding device
US10198784B2 (en) Capturing commands in a multi-engine graphics processing unit
CN113138755A (en) JSON serialization and deserialization optimization method and system
CN113641594B (en) Cross-terminal automatic testing method and related device
CN115391181A (en) Verification method of SOC chip
JP2010123060A (en) Method of accessing unknown object
US10546416B2 (en) Techniques for modifying graphics processing unit (GPU) operations for tracking in rendering images
KR101485561B1 (en) Method for loading and using dll of am cad in real-time
US8949774B2 (en) Generated object model for test automation
CN112817585A (en) Cocos2dx UI interface building method based on Unity editor
CN115344243B (en) Component packaging method and system of X6 flow chart
JPH11154093A (en) Program compiler and storage medium recording compiler program
CN102063307A (en) Graphical user interface creating method and system of embedded digital video recorder
CN108553899A (en) A kind of i.e. point plays the development device and its method of game
CN112612712B (en) Software breakpoint debugging method and device based on extended script
Raffaillac et al. Turning function calls into animations
CN117289910A (en) Language chain development and debugging integrated tool, method and storage medium
CN117149622A (en) Test method and device based on vehicle-mounted SOA and electronic equipment

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 210000 Room 301, floor 3, building 75, zone B, entrepreneurship and innovation city, No. 15, Fengji Avenue, Yuhuatai District, Nanjing, Jiangsu Province

Patentee after: Nanjing Thunderbolt Information Technology Co.,Ltd.

Address before: 210000 Room 301, floor 3, building 75, zone B, entrepreneurship and innovation city, No. 15, Fengji Avenue, Yuhuatai District, Nanjing, Jiangsu Province

Patentee before: NANJING LEADING INFORMATION TECHNOLOGY Co.,Ltd.

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A Implementation Method for Situation Review on GIS Platform

Granted publication date: 20221216

Pledgee: Bank of Nanjing Co.,Ltd. Jiangning sub branch

Pledgor: Nanjing Thunderbolt Information Technology Co.,Ltd.

Registration number: Y2024980019591