Cross-platform data read-write adaptation method and system

Through the cross-platform data reading and writing adaptation method, by splitting command sequences and generating mapping tables, the problem of data storage adaptation for different platforms in embedded software development is solved, improving development efficiency and reducing software complexity.

CN118550458AInactive Publication Date: 2024-08-27BEIJING JADE BIRD HUANYU FIRE FIGHTING SYST SOFTWARE SERVICE CO +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410597691.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-08-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In embedded software development, the software needs to adapt to changes in data storage methods of different hardware and software platforms, resulting in a long code development cycle and complex structure. Especially when the hardware or software platform is replaced, the original data storage method is not applicable and needs to be modified. Code refactoring.

Method used

Using a cross-platform data reading and writing adaptation method, by splitting the command sequence and generating a step sequence and mapping table based on the mapping relationship, developers are allowed to directly access different storage spaces, avoid caring about storage addresses and media, and realize cross-platform data reading. Write.

Benefits of technology

It improves development efficiency and reduces software complexity, allowing developers to efficiently access data in different storage media without modifying the code. They only need to update the mapping table to adapt to changes in storage media.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550458A
    Figure CN118550458A
Patent Text Reader

Abstract

The invention discloses a cross-platform data read-write adaptation method and system, and the method comprises the following steps: S1, splitting a command sequence needing data read-write according to software functions, defining n sequence commands xn as x, and continuing to split the command sequence xn into subsequences y if the value range of n exceeds an allowable maximum value; s2, mapping the command sequence to mapping of different storage spaces according to a mapping relation F, defining the mapping as M, generating a step finger sequence A according to a mapping step value a, and generating a mapping table D after the mapping is ended; and S3, accessing the content of the mapping table D of the different storage spaces according to the command sequence, and completing the reading and writing of the data of the different storage spaces. Developers can directly and indirectly access different storage space contents through the command sequence without concerning actual storage addresses and storage media, the development efficiency is improved, and the software complexity is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software data reading and writing, and in particular to a cross-platform data reading and writing adaptation method and system. Background Art

[0002] At present, in the process of embedded software development, there are products developed based on different hardware and software platforms on the market, and application software also needs to support different hardware and software development platforms, especially when it comes to data storage methods, there are many categories, including but not limited to: memory space, flash space, database, etc. If the developed software needs to replace the hardware platform or software platform, the original data storage method is no longer suitable for the new hardware. Software developers need to adapt the software or even refactor the code, which results in a long code development cycle and complex code structure. Summary of the invention

[0003] The purpose of the present invention is to provide a cross-platform data read and write adaptation method and system, whereby developers can directly access different storage space contents indirectly through command sequences without having to worry about the actual storage address and storage medium, thereby improving development efficiency and reducing software complexity.

[0004] In order to achieve the purpose of the present invention, a cross-platform data reading and writing adaptation method of the present invention comprises the following steps: S1. Split out a command sequence that needs to read and write data according to the software function, and define n of the sequence commands xn as x. If the value range of n exceeds the maximum value allowed, the command sequence xn is further split into subsequences y. S2, mapping the command sequence to different storage spaces according to the mapping relationship F, the mapping definition is M, generating a stepping index sequence A according to the mapping step value a, and generating a mapping table D after the mapping is terminated; The mapping relationship includes but is not limited to table lookup and calculation; The storage space includes but is not limited to memory space, flash space and database space; S3. According to the command sequence, access the contents of the mapping table D of the different storage spaces to complete the reading and writing of the data in the different storage spaces.

[0005] Further: in step S1, the command sequence x={x1,x2,x3,…,x n}, the number of command sequences n is generally not greater than 50.

[0006] Further: in step S2, M=F(x×a+b) realizes mapping to different storage spaces, where F is the mapping relationship, b is the address offset, and a is the mapping step value.

[0007] Further: the step value a is a fixed value or is defined according to the value of x.

[0008] Further: the command sequence includes reading system configuration parameters.

[0009] Further: the step value a is defined according to the value of x, forming a step value sequence A={a1,a2,a3, …,a n}.

[0010] Further: the storage space is memory space, flash space or database.

[0011] 8. A cross-platform data reading and writing adaptation method according to claim 3, characterized in that: The mapping table is D=[M1, M2, ,M3, …,M n ].

[0012] Another technical solution of the present invention is: a cross-platform data reading and writing adaptation system, characterized by comprising: A definition module is used to split a command sequence that needs to read and write data according to the software function. n of the sequence commands xn are defined as x. If the value range of n exceeds the maximum value allowed, the command sequence xn is further split into subsequences y. A mapping module, which establishes a mapping from the command sequence to different storage spaces according to the mapping relationship F, wherein the mapping definition is M, and generates a stepping index sequence A according to the stepping value a, and generates a mapping table D after the mapping is terminated; The mapping relationship includes but is not limited to table lookup and calculation; The storage space includes but is not limited to memory space, flash space and database space; The read / write module accesses the content of the mapping table D of the different storage spaces according to the command sequence, and completes the reading and writing of the data in the different storage spaces.

[0013] Compared with the prior art, the present invention provides a cross-platform data reading and writing adaptation method and system, which has the following beneficial effects: The present invention is used by developers in developing software. Developers can directly and indirectly access the contents of different storage spaces through command sequences. Through the above steps, access to data applied to different storage media can be efficiently completed. Developers only need to read and write data according to the defined command sequence without worrying about the actual storage address and storage medium. If the storage medium needs to change the parameters, the mapping table can be directly modified, thereby improving development efficiency and reducing software complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1It is a flow chart of a cross-platform data reading and writing adaptation method of the present invention; Figure 2 It is a schematic diagram of a cross-platform data reading and writing adaptation system of the present invention. DETAILED DESCRIPTION

[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0016] See also Figure 1 , an embodiment of the present invention provides a cross-platform data reading and writing adaptation method, comprising the following steps: S1. Split out the command sequence that needs to read and write data according to the software function, n of the sequence commands x n Defined as x, the command sequence x={x1,x2,x3,…,x n}; If the value range of n exceeds the maximum allowed value, the command sequence x n Continue to split into subsequence y. Usually, n>0, n is generally less than 50. If n is greater than 50, then x n Split the data without limiting the maximum value range of n.

[0017] For example, the command sequence includes reading system configuration parameter 1, configuration parameter 2 and configuration parameter 3, defining the data reading and writing command sequence and generating a command sequence group x={read parameter 1, write parameter 1, read parameter 2, write parameter 2, read parameter 3, write parameter 3}; S2. Map the command sequence to different storage spaces according to the mapping relationship F, where the mapping definition is M, and generate a stepping instruction sequence A according to the mapping step value a, where A={a1, a2, a3, …, a n}, after the mapping is terminated, a mapping table D is generated, which is D=[ M1, M2, ,M3, …,M n ].

[0018] The mapping relationship includes but is not limited to table lookup and calculation; The storage space includes but is not limited to memory space, flash space and database space; In this example, firstly, a mapping relationship is established for parameter 1, parameter 2 and parameter 3 to be mapped to storage, and the command sequence is mapped to different storage spaces by defining M=F(x×a+b) respectively, where F is the mapping relationship, b is the address offset, and a is the mapping step value. The storage space is memory space, flash space or database. According to different software requirements, the physical medium for parameter storage is different. Among them, parameter 1 is stored in the memory space, parameter 2 is stored in the flash space, and parameter 3 is stored in the database. The mapping of the command sequence to the storage space is achieved by defining M=F(x×a+b) respectively. The mapping of parameter 1 is M1=parameter 1×a1+b1; the mapping of parameter 2 is M2=parameter 2×a2+b2; the mapping of parameter 3 is M3=parameter 3×a3+b3; After the mapping is terminated, the mapping table D = [M1, M1, M2, M2, M3, M3] of this instance is established, where the two M1s correspond to read parameter 1 and write parameter 1 respectively; S3. According to the numerical value in the command sequence group, directly index to the corresponding mapping in the mapping table to complete the reading and writing of the command sequence. For example, when it is necessary to read and write data for parameter 1, directly index to M1 in mapping table D according to the operation object parameter 1 to complete the reading and writing of data. When it is necessary to read and write data for parameter 2, directly index to M2 in mapping table D according to the operation object parameter 2 to complete the reading and writing of data. When it is necessary to read and write data for parameter 3, directly index to M3 in mapping table D according to the operation object parameter 3 to complete the reading and writing of data.

[0019] If you need to modify or add parameters, you can directly modify or add the command sequence X and mapping table D.

[0020] In one embodiment of the present invention, the mapping relationship includes but is not limited to table lookup or calculation. It is more efficient to map the relationship by table lookup.

[0021] In one embodiment of the present invention, the step value a is a fixed value, or the step value a is defined according to the value of x.

[0022] The present invention provides a cross-platform data reading and writing adaptation system, including: Define the module, split the command sequence that needs to read and write data according to the software function, n of the sequence commands x n Defined as x, if the value range of n exceeds the maximum allowed, the command sequence x n Continue to split into subsequence y; A mapping module, which establishes a mapping from the command sequence to different storage spaces according to the mapping relationship F, wherein the mapping definition is M, and generates a stepping index sequence A according to the stepping value a, and generates a mapping table D after the mapping is terminated; The mapping relationship includes but is not limited to table lookup and calculation; The storage space includes but is not limited to memory space, flash space and database space; The read / write module accesses the content of the mapping table D of the different storage spaces according to the command sequence, and completes the reading and writing of the data in the different storage spaces.

[0023] The above are only preferred specific implementation modes of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solutions and inventive concepts of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A cross-platform data reading and writing adaptation method, It is characterized in that The following steps are involved: S1. Split out the command sequence that needs to read and write data according to the software function, n of the sequence commands x n Defined as x, if the value range of n exceeds the maximum allowed, the command sequence x n Continue to split into subsequence y; S2, mapping the command sequence to different storage spaces according to the mapping relationship F, the mapping definition is M, generating a stepping index sequence A according to the mapping step value a, and generating a mapping table D after the mapping is terminated; The mapping relationship includes but is not limited to table lookup and calculation; The storage space includes but is not limited to memory space, flash space and database space; S3. According to the command sequence, access the contents of the mapping table D of the different storage spaces to complete the reading and writing of the data in the different storage spaces.

2. A cross-platform data reading and writing adaptation method according to claim 1, Features: In step S1, the command sequence x={x1,x2,x3,…,x n }, the number of command sequences n is generally not greater than 50.

3. According to the cross-platform data reading and writing adaptation method of claim 1, Features: In step S2, M=F(x×a+b) realizes mapping to different storage spaces, where F is the mapping relationship, b is the address offset, and a is the mapping step value.

4. A cross-platform data reading and writing adaptation method according to claim 3, Features: The step value a is a fixed value or is defined according to the value of x.

5. A cross-platform data reading and writing adaptation method according to claim 1, Features: The command sequence includes reading system configuration parameters.

6. A cross-platform data reading and writing adaptation method according to claim 3, Features: The step value a is defined according to the value of x, forming a step value sequence A={a1,a2,a3, …, a n }.

7. A cross-platform data reading and writing adaptation method according to claim 1, Features: The storage space is memory space, flash space or database.

8. A cross-platform data reading and writing adaptation method according to claim 3, Features: The mapping table is D=[M1, M2, ,M3, …,M n ].

9. A cross-platform data reading and writing adaptation system, It is characterized in that include: Define the module, split the command sequence that needs to read and write data according to the software function, n of the sequence commands x n Defined as x, if the value range of n exceeds the maximum allowed, the command sequence x n Continue to split into subsequence y; A mapping module, which establishes a mapping from the command sequence to different storage spaces according to the mapping relationship F, wherein the mapping definition is M, and generates a stepping index sequence A according to the stepping value a, and generates a mapping table D after the mapping is terminated; The mapping relationship includes but is not limited to table lookup and calculation; The storage space includes but is not limited to memory space, flash space and database space; The read / write module accesses the contents of the mapping table D of the different storage spaces according to the command sequence, and completes the reading and writing of the data in the different storage spaces.

Citation Information

Patent Citations

  • Data reading and writing method and device for resource limited device and instruction set

    CN113760193A

  • Instructions with multiple memory access modes

    US11841792B1