Data modeling method and device, storage medium and electronic equipment

By using data modeling methods to generate main tables and subtables in the data acquisition and management of battery swap station equipment, the problem of data acquisition and storage complexity is solved, and efficient data management and analysis is achieved.

CN119646014APending Publication Date: 2025-03-18北京胜能能源科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411441339.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the process of data collection and management of battery swap station equipment, due to the large number of collection items and the need to distinguish different station types, the data collection and storage are complicated, and the station control management platform is difficult to manage data.

Method used

A data modeling method is proposed, by determining the target protocol of the target battery swap station, the table creation SQL statements of the corresponding main table and subtable are generated, and these statements are executed to generate the database table. The method includes determining the target protocol, generating table build SQL statements and executing them to generate the primary and subtables, and obtaining the final database table through association processing.

Benefits of technology

It improves table construction efficiency, reduces table construction costs, achieves good standardization and scalability, and facilitates the management of data collected by subsequent station control management platforms for battery swap equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646014A_ABST
    Figure CN119646014A_ABST
Patent Text Reader

Abstract

The invention discloses a data modeling method and device, a storage medium and electronic equipment. The method comprises the steps that a target protocol of a target battery swap station is determined, the target protocol comprises a plurality of fields and attribute information of the fields, and the fields comprise action list fields corresponding to the battery swap devices in the one-time battery swap process; generating a first table building sql statement according to the field, a first preset rule and attribute information thereof, and generating a second table building sql statement according to the field, the attribute information thereof and a second preset rule; and executing the first table building sql statement to generate a corresponding main table, and executing the second table building sql statement to generate a corresponding sub-table. According to the method, the table building efficiency is improved, the table building cost is reduced, good standardization and expansibility are achieved, and the subsequent management of the station control management platform on the data collected by the power conversion equipment is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data modeling method, device, storage medium, and electronic device. Background Art

[0002] Whether the equipment in the battery swap station operates normally directly affects whether the battery swap service can be carried out normally. To measure whether the equipment in the battery swap station can operate normally, the torque, position, operating time and other data of each battery swap equipment (such as tightening guns, locking and unlocking claws, etc.) during the battery swap process can be used. By collecting, analyzing and monitoring the data of the battery swap equipment, abnormalities of the battery swap equipment can be discovered in time, and then early warning and maintenance can be carried out to avoid equipment failures during the battery swap service that affect the battery swap business.

[0003] However, when collecting the above data, since there are many collection items and different station types (such as commercial stations, passenger stations, etc.) need to be distinguished, the collection and storage of data is relatively complicated, which makes it difficult for the station control management platform to manage the data. Summary of the invention

[0004] The present invention aims to solve one of the technical problems in the related art to at least a certain extent. To this end, the purpose of the present invention is to propose a data modeling method, device, storage medium, and electronic device to improve the efficiency of meter building, reduce the cost of meter building, and achieve good standardization and scalability, so as to facilitate the subsequent station control management platform to manage the data collected by the battery swapping equipment.

[0005] To achieve the above-mentioned purpose, the first aspect of the embodiment of the present invention proposes a data modeling method, which includes: determining a target protocol of a target battery swap station, wherein the target protocol includes multiple fields and attribute information of each field, and the multiple fields include an action list field corresponding to each battery swap device in a battery swap process; generating a first table creation SQL statement based on the fields and a first preset rule and its attribute information, and generating a second table creation SQL statement based on the fields and their attribute information and a second preset rule; executing the first table creation SQL statement to generate a corresponding main table, and executing the second table creation SQL statement to generate a corresponding sub-table.

[0006] In addition, the data modeling method of the embodiment of the present invention may also have the following additional technical features:

[0007] According to one embodiment of the present invention, the method also includes: determining a target number of data items; comparing the number of data items in the action list corresponding to each of the battery exchange devices in the target battery exchange station with the target number of data items; for an action list in which the number of data items is not equal to the target number of data items, aligning the sub-table corresponding to the action list so that the number of data items in the action list is equal to the target number of data items.

[0008] According to one embodiment of the present invention, determining the target number of data items includes: determining the maximum number of data items from the number of data items in the action list corresponding to each battery swapping device in the target battery swapping station, and using the maximum number of data items as the target number of data items.

[0009] According to an embodiment of the present invention, the method further includes: performing association processing on the main table and the corresponding sub-table to obtain a final database table of the target battery swap station.

[0010] According to an embodiment of the present invention, the associating the main table with the corresponding sub-table includes: adding preset identifiers to the main table and the corresponding sub-table respectively, so as to achieve the association between the main table and the corresponding sub-table through the preset identifiers.

[0011] According to one embodiment of the present invention, the multiple fields also include basic fields in a battery swap process and a storage location number field corresponding to each battery swap device, wherein the basic fields include a battery swap station code field, a battery swap order number field, and a license plate number field of the battery swap vehicle.

[0012] According to one embodiment of the present invention, the attribute information includes field types and comments, and the number of sub-tables is multiple, corresponding one-to-one to the multiple action list fields, and the position number field corresponding to each battery swapping device in a battery swapping process is the same; wherein, the first preset rule includes: using each action list field as the data field of the main table, and using the comments of each action list field as the comments of the corresponding data field; the second preset rule includes: using the event name corresponding to the action list field as the sub-table name of the corresponding sub-table, and using the position number field, battery swapping station code field, battery swapping order number field, and license plate number field corresponding to the action list field as the data field of the corresponding sub-table, and using the field type of the position number field, battery swapping station code field, battery swapping order number field, and license plate number field corresponding to the action list field as the field type of the corresponding sub-table data field.

[0013] To achieve the above-mentioned purpose, the second aspect of the embodiment of the present invention proposes a data modeling device, which includes: a determination module, used to determine the target protocol of the target battery swap station, wherein the target protocol includes multiple fields and attribute information of each field, and the multiple fields include an action list field corresponding to each battery swap device in a battery swap process; a generation module, used to generate a first table creation SQL statement based on the fields and their attribute information, and a first preset rule, and generate a second table creation SQL statement based on the fields and their attribute information, and a second preset rule; an execution module, used to execute the first table creation SQL statement to generate a corresponding main table, and execute the second table creation SQL statement to generate a corresponding sub-table.

[0014] To achieve the above objectives, a third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the data modeling method described in the first aspect of the present invention is implemented.

[0015] To achieve the above objectives, the fourth aspect of the present invention proposes an electronic device, comprising a memory, a processor and a computer program stored in the memory, wherein when the computer program is executed by the processor, the data modeling method described in the first aspect of the present invention is implemented.

[0016] The data modeling method, device, storage medium, and electronic device of the embodiment of the present invention first determine the target protocol of the target battery swap station, which includes multiple fields and attribute information of each field, and the multiple fields include an action list field corresponding to each battery swap device in a battery swap process; then generate a first table creation sql statement based on the field and the first preset rule and its attribute information, and generate a second table creation sql statement based on the field and its attribute information, and the second preset rule; then execute the first table creation sql statement to generate the corresponding main table, and execute the second table creation sql statement to generate the corresponding sub-table. In this way, the efficiency of table creation can be improved, the cost of table creation can be reduced, and good standardization and extensibility can be achieved, which facilitates the management of the data collected by the battery swap equipment by the subsequent station control management platform.

[0017] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flow chart of a data modeling method according to an embodiment of the present invention;

[0019] Figure 2 is a flow chart of a data modeling method according to another embodiment of the present invention;

[0020] FIG3( a ) is a graph of battery swapping equipment data for early warning according to an example of the present invention;

[0021] FIG3( b ) is a graph of battery swapping equipment data for early warning according to another example of the present invention;

[0022] Figure 4 is a structural block diagram of a data modeling device according to an embodiment of the present invention;

[0023] Figure 5 It is a structural block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0025] During the battery swapping process at the battery swapping station, the station control management platform collects data (such as torque, position, running time, etc.) of the battery swapping equipment (such as tightening guns, locking and unlocking, hooks, etc.) according to the agreed protocol (such as the agreement with the cloud). There are many collection items, and it is necessary to distinguish different station types (such as commercial stations, passenger stations, etc.). Among them, commercial stations are used for commercial vehicle battery swapping, and passenger stations are used for passenger vehicle battery swapping. The following Table 1 shows some of the protocol items for passenger vehicles:

[0026] Table 1

[0027]

[0028]

[0029] Since the collection items are different (each station type can have up to 20 collection items), the contents of the collection items of different station types are also different, so the collection message is relatively complex. Therefore, how to effectively, flexibly and efficiently realize data storage to provide favorable support for subsequent station control management platform to perform data analysis and monitoring is a technical problem to be solved by the present invention. To solve this problem, the present invention proposes a data modeling method, device, storage medium, and electronic device.

[0030] First, the modeling idea of ​​the present invention is described:

[0031] There are many message items that need to be reported in a battery replacement process, and the data items such as torque and position involved (used to draw curves) have multiple storage forms in the database, including list form and single value form (passenger cars are only in list form). Since the list form as a field in the database cannot directly meet the drawing requirements in data analysis, if you want to use the list form data for drawing, you need to treat each item in the list as a separate data item, and also consider the correlation between the list and other lists, that is, whether the data items in the list and the data items in other lists belong to the same action items coordinated in the battery replacement process. If there is a correlation, the list cannot be viewed independently. In addition, for commercial vehicles, the data is divided into list form and single value form, and the single value form requires multiple complete battery replacement processes (one battery replacement process forms a battery replacement order) for comparison. During the entire data analysis process, data reading and processing are relatively complicated.

[0032] To this end, the present invention proposes to model the data of the battery swapping equipment to facilitate storage and reading. When modeling, considering that there is no need for comparison between different station types, different station types (such as passenger cars and commercial vehicles) are divided to store data separately. Taking passenger cars as an example, the battery swapping equipment data of the battery swapping process reported by the passenger car battery swapping station is divided into a main table and a sub-table. The main table is based on the battery swapping order, that is, one battery swapping order corresponds to one piece of equipment data, including multiple lists. The data in the list is placed in a field as a string, reflecting the complete battery swapping process; the sub-table is the equipment action data corresponding to each list, that is, one list corresponds to one sub-table. The purpose is to split the data items in the list into single items for subsequent drawing and early warning. A reported message will involve as many as 20 data tables. If these data tables are all done manually, it will be time-consuming and labor-intensive, and there are many table names and more than 200 data items. The table for commercial vehicles is more complicated and the data items are more cumbersome. Once the protocol is modified, it is necessary to screen and modify the tables one by one. To this end, the present invention utilizes a protocol or a message to automatically generate a table building script (ie, a table building SQL statement), and the table building script supports flexible modification and also supports flexible data acquisition of the final curve.

[0033] The data modeling method, device, storage medium, and electronic device of the embodiments of the present invention are described below with reference to the accompanying drawings.

[0034] Figure 1 It is a flow chart of a data modeling method according to an embodiment of the present invention.

[0035] like Figure 1 As shown, the data modeling approach includes:

[0036] S11, determine the target protocol of the target battery swap station, wherein the target protocol includes multiple fields and attribute information of each field, and the multiple fields include an action list field corresponding to each battery swap device in a battery swap process.

[0037] The target battery swap station can be a passenger station, a commercial station, or other types, which can be selected according to needs. Attribute information may include field types (such as variable-length character strings varchar, normal-size integers int, single-precision floating-point numbers float, etc.), comments, etc. The action list corresponding to the action list field can be a torque value set, a position value set, etc. of the battery swap device during a battery swap process.

[0038] In some embodiments of the present invention, the multiple fields also include basic fields in a battery swap process and a storage location field corresponding to each battery swap device, wherein the basic fields include a battery swap station code field, a battery swap order number field, and a battery swap vehicle license plate number field. The license plate number can also be replaced with the vehicle's VIN (Vehicle Identification Number), as long as it can identify the identity of the vehicle.

[0039] The target protocol can be stored in the execl table. Taking passenger cars as an example, some of the target protocols in the execl table are shown in Table 2 below:

[0040] Table 2

[0041]

[0042]

[0043] Taking passenger cars as an example, in the protocols or messages of the relevant technology, leftFrontWheel is a key (attribute) in a json (JavaScript Object Notation, JS object notation), and the corresponding value (value) contains two key values ​​leftFrontWheelList and binNo, that is, there is leftFrontWheel:{leftFrontWheelList:[],binNo:x}. Therefore, when designing a table, leftFrontWheel is placed before list and binNo as a prefix of an event. List and binNo are used to describe the data of this event. In this way, the event can be fully described and which event it is, and it can be automated. Similar processing is performed on other events. Therefore, the protocol (or message) can be used to automatically define the data table name and field name, so that the data table can be automatically created, and each action can be clearly divided.

[0044] S12, generating a first table creation SQL statement according to the field and the first preset rule and its attribute information, and generating a second table creation SQL statement according to the field and its attribute information and the second preset rule.

[0045] In some embodiments of the present invention, there are multiple sub-tables, which correspond to multiple action list fields one by one, and the position number field corresponding to each battery swapping device in a battery swapping process is the same. Among them, the first preset rule includes: using each action list field as the data field of the main table, and using the annotation of each action list field as the annotation of the corresponding data field; the second preset rule includes: using the event name corresponding to the action list field as the sub-table name of the corresponding sub-table, and using the position number field, battery swap station code field, battery swap order number field, and license plate number field corresponding to the action list field as the data field of the corresponding sub-table, and using the field type of the position number field, battery swap station code field, battery swap order number field, and license plate number field corresponding to the action list field as the field type of the corresponding sub-table data field.

[0046] Specifically, for the main table, all fields in the Excel table corresponding to the target protocol can be used as data fields of the main table, and a table creation script for the main table (i.e., the first table creation SQL statement) can be generated based on the data fields. Specifically, the table creation SQL script for the main table can be generated by concatenating strings with the help of the programming language SQL (Structured Query Language).

[0047] For sub-tables, taking passenger cars as an example, each event similar to leftFrontWheel can be used as a sub-table (for commercial vehicles, only the list in the event needs to be separated as a sub-table). The basic fields of the main table will be added to each sub-table, such as sid, on, cn in Table 2, etc. Each sub-table has the items list and binno (if the target battery swap station is a commercial station, the start time starttime and end time endtime must also be added to the sub-table). The event name is used as the sub-table name, and the basic information of the main table and list and binno are used as data items of the sub-table. With the help of programming language, the sub-table creation script (that is, the second table creation SQL statement) can be generated.

[0048] S13, execute the first table creation sql statement to generate the corresponding main table, and execute the second table creation sql statement to generate the corresponding sub-table.

[0049] Specifically, the first table creation sql statement and the second table creation sql statement are both scripts for automatically creating tables. Therefore, by executing the first table creation sql statement and the second table creation sql statement, corresponding database tables, including a main table and a sub-table, can be automatically generated in a preset database.

[0050] The data modeling method of this embodiment can improve table building efficiency, reduce table building costs, and achieve good standardization and scalability by automatically generating SQL statements for table building and corresponding database tables, thereby facilitating the management of data collected by battery swapping equipment by subsequent station control management platforms.

[0051] In some embodiments of the present invention, after generating the sub-table, such as Figure 2 As shown, the data modeling method also includes:

[0052] S21, determine the number of target data items.

[0053] Specifically, the maximum number of data items can be determined from the number of data items in the action list corresponding to each battery swapping device in the target battery swapping station, and the maximum number of data items can be used as the target number of data items.

[0054] S22, respectively compare the number of data items in the action list corresponding to each battery swapping device in the target battery swapping station with the target number of data items.

[0055] S23, for an action list whose number of data items is not equal to the target number of data items, an alignment operation is performed on the sub-table corresponding to the action list, so that the number of data items in the action list is equal to the target number of data items.

[0056] In this embodiment, in order to standardize the subsequent storage and mapping, the list can be split into items according to the maximum length as the largest data item (the maximum number of data items is different for different station types, for example, 199 for passenger cars and 300 for commercial vehicles, which can be set according to the collection points of the specific station type). If the reported list length is not enough, the subtable corresponding to the list is padded with 0 to achieve alignment of all subtables for subsequent storage and mapping. Taking passenger cars as an example, the maximum list has a total of 199 numbers, and the data items of the subtable are t001, t002, ..., t199. If the reported message list length is not 199, data items are added to the end of the list until it reaches 199 to facilitate alignment; and when the subtable data is stored, the corresponding data of the newly added data items are all 0.

[0057] In some embodiments of the present invention, after generating the main table and the sub-table, the data modeling method further includes: performing association processing on the main table and the corresponding sub-table to obtain a final database table of the target battery swap station.

[0058] Specifically, associating the main table with the corresponding sub-table may include: adding preset identifiers to the main table and the corresponding sub-table respectively, so as to achieve association between the main table and the corresponding sub-table through the preset identifiers.

[0059] In this embodiment, each record in the sub-table needs to correspond to a record in the main table one by one. A preset identification ID can be added to the main table, and the ID is also added to the sub-table, and each sub-table is associated with the main table using the ID.

[0060] Taking passenger cars as an example, the prefix is ​​passenger, the main table obtained is shown in Table 3 below, and the subtable passenger_leftfrontwheel obtained is shown in Table 4 below (the structure of other subtables is similar to Table 4):

[0061] Table 3

[0062]

[0063]

[0064] Table 4

[0065] Field Name Field Type id varchar sid varchar on_ varchar cn varchar binno int4 t000 float8 t001 float8 t002 float8 ... ... t197 float8 t198 float8

[0066] Taking commercial vehicles as an example, the prefix is ​​commercial, the main table obtained is shown in Table 5 below, and the sub-table commercial_takefromtrucktorquex obtained is shown in Table 6 below (the structures of other sub-tables are similar to those in Table 6).

[0067] Table 5

[0068]

[0069]

[0070] Table 6

[0071] Field Name type sid varchar chlno varchar vin varchar on_ varchar binno int4 starttime timestamp endtime timestamp t00 float8 t01 float8 t02 float8 ... ... t299 float8

[0072] In Table 6, chlno is a preset identifier for associating with the corresponding main table, and vin is a vehicle identification code of a commercial vehicle, which is used to uniquely identify the vehicle.

[0073] After obtaining the main table and sub-table, the station control management platform can conveniently store data based on the main table and sub-table, and can read data for data analysis to monitor the battery replacement process. On the one hand, the station control management platform can read the stored data and generate curves for early warning judgment, as shown in Figure 3(a) and Figure 3(b). Figure 3(a) shows a partial relationship curve between the torque value and time in the process of the stacker lifting the low-power battery from the cache position to the battery position under multiple orders. Figure 3(b) shows a partial relationship curve between the torque value and time in the process of the stacker lifting the fully charged battery from the battery position to the cache position under multiple orders. The operation and maintenance personnel can use this curve to check whether the action of the stacker is abnormal, and the abnormal point when there is an abnormality. On the other hand, the station control management platform can compare the read storage data with the threshold, and determine whether to issue an abnormal warning based on the comparison result.

[0074] Figure 4 It is a structural block diagram of a data modeling device according to an embodiment of the present invention.

[0075] like Figure 4 As shown, the data modeling device 400 includes: a determination module 410 , a generation module 420 and an execution module 430 .

[0076] Among them, the determination module 410 is used to determine the target protocol of the target battery swap station, wherein the target protocol includes multiple fields and attribute information of each field, and the multiple fields include an action list field corresponding to each battery swap device during a battery swap process. The generation module 420 is used to generate a first table creation sql statement based on the field and its attribute information, and a first preset rule, and to generate a second table creation sql statement based on the field and its attribute information, and a second preset rule. The execution module 430 is used to execute the first table creation sql statement to generate the corresponding main table, and execute the second table creation sql statement to generate the corresponding sub-table.

[0077] Based on the data modeling method of the above embodiment, the present invention proposes a computer-readable storage medium.

[0078] In this embodiment, a computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the data modeling method described in the above embodiment is implemented.

[0079] Based on the data modeling method of the above embodiment, the present invention also proposes an electronic device.

[0080] Figure 5 It is a structural block diagram of an electronic device according to an embodiment of the present invention.

[0081] like Figure 5 As shown, the electronic device 500 includes: a processor 501 and a memory 503. The processor 501 and the memory 503 are connected, such as through a bus 502. Optionally, the electronic device 500 may also include a transceiver 504. It should be noted that in actual applications, the transceiver 504 is not limited to one, and the structure of the electronic device 500 does not constitute a limitation on the embodiments of the present invention.

[0082] Processor 501 may be a CPU (Central Processing Unit), a general purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 501 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0083] The bus 502 may include a path to transmit information between the above components. The bus 502 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 502 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0084] The memory 503 is used to store a computer program corresponding to the asynchronous serial communication method of the above embodiment of the present invention, and the computer program is controlled and executed by the processor 501. The processor 501 is used to execute the computer program stored in the memory 503 to implement the contents shown in the above method embodiment.

[0085] Among them, the electronic device 500 includes but is not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device 500 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0086] In summary, the data modeling method, device, storage medium, and electronic device of the embodiments of the present invention can improve table building efficiency, reduce table building costs, and achieve good standardization and extensibility by modeling the collected data of the battery swapping equipment to obtain a main table and one or more sub-tables, thereby facilitating the subsequent station control management platform to manage the collected data of the battery swapping equipment.

[0087] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0088] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0089] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0090] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0091] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0092] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0093] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.

[0094] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A data modeling method, characterized in that: The method comprises: Determine a target protocol of a target battery swap station, wherein the target protocol includes multiple fields and attribute information of each field, and the multiple fields include an action list field corresponding to each battery swap device during a battery swap process; Generate a first table creation SQL statement according to the field and the first preset rule and its attribute information, and generate a second table creation SQL statement according to the field and its attribute information and the second preset rule; Execute the first table creation sql statement to generate a corresponding main table, and execute the second table creation sql statement to generate a corresponding sub-table.

2. The data modeling method according to claim 1, characterized in that: The method further comprises: Determine the target number of data items; Respectively compare the number of data items in the action list corresponding to each battery swapping device in the target battery swapping station with the target number of data items; For an action list whose number of data items is not equal to the target number of data items, an alignment operation is performed on the sub-table corresponding to the action list so that the number of data items in the action list is equal to the target number of data items.

3. The data modeling method according to claim 1, characterized in that: The determining of the target number of data items includes: The maximum number of data items is determined from the number of data items in the action lists corresponding to the battery swapping devices in the target battery swapping station, and the maximum number of data items is used as the target number of data items.

4. The data modeling method according to claim 1, characterized in that: The method further comprises: The main table and the corresponding sub-table are associated to obtain the final database table of the target battery swap station.

5. The data modeling method according to claim 4, characterized in that: The associating processing of the main table and the corresponding sub-table includes: Preset identifiers are added to the main table and the corresponding sub-tables respectively, so as to realize the association between the main table and the corresponding sub-tables through the preset identifiers.

6. The data modeling method according to claim 1, characterized in that: The multiple fields also include basic fields in a battery swap process and a storage location number field corresponding to each battery swap device, wherein the basic fields include a battery swap station code field, a battery swap order number field, and a license plate number field of the battery swap vehicle.

7. The data modeling method according to claim 6, characterized in that: The attribute information includes field type and annotation, the number of sub-tables is multiple, corresponding to multiple action list fields one by one, and the slot number field corresponding to each battery swapping device in a battery swapping process is the same; wherein, The first preset rule includes: using each of the action list fields as a data field of the main table, and using the comment of each of the action list fields as a comment of the corresponding data field; The second preset rule includes: using the event name corresponding to the action list field as the sub-table name of the corresponding sub-table, and using the storage location number field, battery swap station code field, battery swap order number field, and license plate number field corresponding to the action list field as the data fields of the corresponding sub-table, and using the field types of the storage location number field, battery swap station code field, battery swap order number field, and license plate number field corresponding to the action list field as the field types of the corresponding sub-table data fields.

8. A data modeling device, characterized in that: The device comprises: A determination module, used to determine a target protocol of a target battery swap station, wherein the target protocol includes multiple fields and attribute information of each field, and the multiple fields include an action list field corresponding to each battery swap device during a battery swap process; A generating module, configured to generate a first table creation SQL statement according to the field and its attribute information, and a first preset rule, and to generate a second table creation SQL statement according to the field and its attribute information, and a second preset rule; An execution module is used to execute the first table creation SQL statement to generate a corresponding main table, and execute the second table creation SQL statement to generate a corresponding sub-table.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data modeling method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein when the computer program is executed by the processor, the data modeling method according to any one of claims 1 to 7 is implemented.