Data structure changing method and related equipment
By building the target-based model and derived model, the system resource consumption problem caused by the increase in model structure during production is solved, efficient change and expansion of data structures are achieved, and system performance and management efficiency are improved.
Patent Information
- Application Number
- CN202510475635.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the increase in model structure caused by frequent changes in the production process links increases process record management costs and system resource consumption, and reduces system performance.
By building the target base model, the first derived model is generated, and the data structure is changed and expanded based on the model, the need to create running objects for each type of model is reduced. The derived model adopts the parameter structure of the base model to achieve the change and expansion of the data structure.
It reduces the complexity of data structure changes and expansion, reduces resource usage, and improves system performance and production process management efficiency.
Smart Images

Figure CN120407562A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to a method for changing a data structure and related devices. Background Art
[0002] In the field of manufacturing, due to the frequent changes in market demand and production processes, the production process will also change accordingly. Therefore, in related technologies, it is required that the recorded data of the production process can be dynamically adjusted, which may be adding record information of new processes, or adding new parameter structures or parameter values to the records of the original processes.
[0003] Currently, the main links in the production process are usually recorded through event model object data. Once the production process changes, the process record model needs to be changed. Taking the addition of a new process as an example, a new process model and object need to be created at this time, and relevant records are added to the new process object. If there are many extended process links, multiple models and objects need to be created, increasing the complexity of the extension. However, the newly created model structure and the existing model structure may only have slight differences, but both need to save a complete set of model structures respectively. The more frequent the changes, the more model structures will be generated, resulting in an increasing number of model structures that need to be maintained. In this case, not only does the process record management cost increase, but a large amount of duplicate data will consume system resources and reduce system performance.
[0004] In view of this, it is necessary to propose a new method for changing a data structure and related devices to solve the above problems. Summary of the Invention
[0005] This application provides a method for changing a data structure and related devices to solve the problems of changing and expanding the data structure.
[0006] The technical solution of this application is as follows:
[0007] In a first aspect, this application provides a method for changing a data structure. The method includes: constructing a target base model for a target object; where the target base model defines a parameter structure associated with the corresponding target object; generating a first derived model and a running object based on the target base model; and performing a change process on the running object based on the first derived model.
[0008] In some implementations, performing a change process on the running object based on the first derived model includes: performing a change process on the first derived model; generating a copy of the first derived model based on the changed first derived model; and adding first information to the running object based on a preset rule; where the first information includes object structure record information of the target base model and object structure record information of the copy of the first derived model.
[0009] In some implementation manners, performing change processing on the first derived model includes: adding changed member information to the first derived model.
[0010] In some implementation manners, creating a second derived model based on a base model; wherein the base model includes a target base model or a first derived model; and performing change processing on the running object based on the second derived model.
[0011] In some implementation manners, generating a running object based on a target base model includes: generating a copy of the base model based on the target base model; and generating a running object based on the copy of the base model.
[0012] In some implementation manners, after generating the running object, adding second information to the running object based on a preset rule; wherein the second information includes object structure record information of the target base model.
[0013] In some implementation manners, the parameter structure of the target base model includes at least one base model own parameter member; the parameter structure of the derived model includes at least one derived model own parameter member and at least one inherited parameter member, wherein at least one inherited parameter member is inherited from the parameter member of the base model from which the derived model is generated.
[0014] In a second aspect, the present application provides a change device for a data structure, and the device includes: a construction module, a generation module, and a processing module.
[0015] The construction module is configured to construct a target base model of a target object for the target object; wherein the parameter structure associated with the corresponding target object is defined in the target base model. The generation module is configured to generate a first derived model and a running object based on the target base model. The processing module is configured to perform change processing on the running object based on the first derived model.
[0016] In some implementation manners, the processing module is specifically configured to perform change processing on the first derived model; generating a copy of the first derived model based on the first derived model after the change processing; adding first information to the running object based on a preset rule; wherein the first information includes object structure record information of the target base model and object structure record information of the copy of the first derived model.
[0017] In some implementation manners, the processing module is specifically configured to add changed member information to the first derived model.
[0018] In some implementation manners, the generation module is further configured to create a second derived model based on a base model; wherein the base model includes a target base model or a first derived model. The processing module is further configured to add second information to the running object; wherein the second information includes object structure record information of the second derived model.
[0019] In some implementation manners, the generation module is specifically configured to generate a copy of the base model based on the target base model, and generate a running object based on the copy of the base model.
[0020] In some implementation manners, the processing module is further configured to add third information to the running object based on a preset rule, where the third information includes object structure record information of the target base model.
[0021] In some implementation manners, the parameter structure of the target base model includes at least one base model own parameter member. The parameter structure of the derived model includes at least one derived model own parameter member and at least one inherited parameter member, where at least one of the inherited parameter members is inherited from the parameter members of the base model from which the derived model is generated.
[0022] In a third aspect, the present application provides an electronic device. The electronic device includes: a processor and a memory for storing processor-executable instructions; when the processor is configured to execute the instructions, the electronic device implements the method of any possible implementation manner in the first aspect.
[0023] In a fourth aspect, the present application provides a computer-readable storage medium, on which computer program instructions are stored; when the computer program instructions are executed by an electronic device, the electronic device implements the method of any possible implementation manner in the first aspect.
[0024] In a fifth aspect, the present application provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in an electronic device, the processor in the electronic device implements the method of any possible implementation manner in the first aspect.
[0025] Based on any one of the first aspect to the fifth aspect above, the present application at least has the following beneficial effects:
[0026] In this application, a target base model of a target object is constructed to represent the parameter structure characteristics of the target object; a first derivative model is generated based on the target base model, and the first derivative model inherits the parameter structure of the target base model that generates it; a running object is generated based on the target base model. Only one running object needs to be created, and there is no need to create a running object for each type of model, reducing resource occupancy; since the first derivative model inherits the parameter structure of the target base model that generates it, when the data structure is changed and expanded, the change and expansion of the data structure of the running object can be achieved through the first derivative model. In this process, there is no need to create new models and running objects for new processes. Based on the existing first derivative model and running object, the change and expansion of the data structure can be completed, reducing the complexity of the change and expansion of the data structure, making the expansion of the production process more convenient and fast, and improving the system performance.
[0027] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit this application. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application and do not constitute an improper limitation to this application.
[0029] Figure 1 is a schematic diagram of a production process plan recorded in the related art;
[0030] Figure 2 is a schematic flowchart of a method for changing a data structure provided by an embodiment of this application;
[0031] Figure 3 is a schematic diagram of a change in the data structure provided by an embodiment of this application;
[0032] Figure 4 is a schematic diagram of the establishment of a derivative model provided by an embodiment of this application;
[0033] Figure 5 is another schematic flowchart of a method for changing a data structure provided by an embodiment of this application;
[0034] Figure 6 is another schematic flowchart of a method for changing a data structure provided by an embodiment of this application;
[0035] Figure 7 is a schematic structural diagram of a data structure change device provided by an embodiment of this application;
[0036] Figure 8 is a schematic structural diagram of an electronic device provided by an embodiment of this application.
[0037] Reference Signs List
[0038] 700, changing device; 701, construction module; 702, generation module; 703, processing module;
[0039] 800, electronic device; 801, processor; 802, communication interface; 803, memory; 804, bus. DETAILED DESCRIPTION
[0040] In order to enable ordinary people in the art to better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0041] It should be noted that the terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0042] It will also be understood that the term “comprising” indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements and / or components.
[0043] The term "and / or" is used to describe a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. The character " / " generally indicates an "or" relationship between the associated objects.
[0044] The term “exemplary” means “serving as an example, example, or illustration.” Any embodiment described as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0045] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of such features. Throughout this application, unless otherwise specified, "plurality" means two or more.
[0046] The term "at least one" means one or more, and "multiple" means two or more; the term "at least one kind" means one kind or more kinds, and "multiple kinds" means two kinds or more kinds.
[0047] The following explains some terms in the embodiments of the present application to facilitate understanding by those skilled in the art.
[0048] Model: A data structure, which is a set of parameters. Abstract the characteristic parameters of the classification represented by the model to construct the model, including the attributes, member structures, member constraint information, etc. of business data.
[0049] Model copy: A replica of the model, including the specific parameter values of business data.
[0050] Derived model: One model inherits another model. The model being inherited is called the base model, and the inherited model is called the derived model. The derived model inherits the members of the base model, and the derived model can also define its own members. The derived model can be used as the base model to continue derivation. For example, the derived model A is used as the base model to generate the derived model B.
[0051] Running object: Created based on the model copy. The attributes and member structures of the running object come from the model copy, and the initial values of the attributes and members of the running object come from the model or the model copy.
[0052] The following briefly introduces the design concept of the embodiments of the present application:
[0053] In the field of manufacturing, recording the production process is an important management link. It helps to monitor the production process, improve production efficiency, ensure product quality, and achieve traceability, and is used to effectively record the production process of the factory.
[0054] The main implementation solution for recording the production process currently is to record the main links in the production process through event model object data. Each event model creates a corresponding object. During production, the production link process is recorded by adding object data. The event model object data of each link is stored separately in a table, and the event models are associated through a certain relationship, such as a parent-child relationship. When it is necessary to expand the main links of the production process, it is necessary to add an event model, create an object, and add object records.
[0055] Exemplarily, such as Figure 1As shown in the figure, it is a schematic diagram of a production process plan recording in the related art. The plan includes the following implementation steps: First, the user records the production process through the production event model object data. The main members in the production event model object data are: order number, status. Second, in the feeding link during the production process, the feeding model object data is used to record. The main members of the feeding model object data are: order number, status, material object ID, feeding quantity, unit, etc. Then, after the production is completed, reporting work is required. The reporting work link is completed through the reporting work model. The main members of the reporting work model object data are: order number, status, reporting work date, reporter, etc.; each type of model object data is stored separately in a table, and the above three types of models need to construct three tables; when carrying out production, the production process needs to be recorded. When adding data, data needs to be added to each table separately; when querying the production process of a certain order, data needs to be queried from the first table first, and then through the parent-child relationship, data in the second and third tables is queried. Finally, if the production process link needs to be expanded, new models need to be added, objects need to be created, and object records need to be added. For example, if a quality inspection link needs to be added, a quality inspection model needs to be added, a quality inspection object needs to be created, and quality inspection object records need to be added.
[0056] It can be seen from Figure 1 that the newly built model structure and the existing model structure may only have slight differences, but a complete set of model structures need to be saved respectively. The more frequent the changes are, the more model structures will be generated, resulting in more and more model structures that need to be maintained. In this case, not only the process record management cost is increased, but also a large amount of duplicate data will consume system resources and reduce system performance.
[0057] In view of this, the embodiments of the present application provide a method, device, electronic device, and storage medium for changing data structures, which relate to the technical field of data processing, and particularly relate to data structure change technology, and are used to reduce the complexity and resource consumption of data structure change and expansion, and improve system performance.
[0058] The following describes the preferred embodiments of the present application with reference to the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. And without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0059] See Figure 2 , Figure 2 is a schematic flowchart of the method for changing the data structure provided by the embodiments of the present application. The change method includes the following steps:
[0060] Step S201: For the target object, construct the target base model of the target object. Among them, the corresponding parameter structure associated with the target object is defined in the target base model.
[0061] Since the parameter structures of a class of target objects are the same, a unified target base model can be used to represent a class of target objects. For example, a class of events is represented by a single target base model.
[0062] Optionally, the target object can be a main link in the production process, such as production events, feeding events, reporting events, procurement events, and other events involved in the production process, which will not be listed one by one here.
[0063] Exemplarily, taking the target object as a production event as an example, as Figure 3 shown, Figure 3 is a schematic diagram of the change of the data structure provided by the embodiment of the present application. In the model library, a production event base model for production events is constructed.
[0064] The target base model includes a corresponding set of member structures. The member structure combination represents the parameter structure of the target object, that is, the parameter structure of the target object set of the object is defined in the target base model.
[0065] In a possible implementation manner, the parameter structure of the target base model includes at least one base model own parameter member. The base model own parameter member is a parameter member directly belonging to the target base model itself, and the base model own parameter member is not obtained indirectly through inheritance or other means.
[0066] Optionally, the base model own parameter members can be common members of the target object such as order number, order version, order status, order ID, order responsible person, etc., which will not be listed one by one here.
[0067] Taking the production event base model as an example, as Figure 3 shown, the parameter structure of the production event base model includes the order number, order version, and status of the production event.
[0068] Step S202: Generate a first derived model based on the target base model.
[0069] Among them, the derivation rule is: a model can have at most one base model, or it can have no base model. The derived model integrates the member list and member values of the base model and does not reference the attribute values of the base model. The derived model can create its own own members.
[0070] Exemplarily, as Figure 4 shown, Figure 4 is a schematic diagram of the establishment of the derived model provided by the embodiment of the present application. It can be seen from Figure 4 that:
[0071] Model Z is the base model of Model A. The members of Model A include Member 1, Member 2, and Member 3. The base model of Model B is Model A. Then Model B inherits Member 1, Member 2, and Member 3 of the base model A. The own members of Model B are Member 4 and Member 4. Similarly, the base model of Model C is Model A. Then Model C inherits Member 1, Member 2, and Member 3 of the base model A. The own members of Model C are Member 6 and Member 7. Similarly, the base model of Model D is Model C. Then Model D inherits Member 1, Member 2, Member 3, Member 6, and Member 7 of the base model C. The own members of Model D are Member 8 and Member 9.
[0072] Since the first derived model is derived from the target base model, the first derived model inherits the parameter members of the target base model. That is to say, the parameter structure of the first derived model includes at least one inherited parameter member, where at least one inherited parameter member is inherited from the own parameter members of the target base model that generates the first derived model, such as the general members of the target object like order number, order version, order status, order ID, order responsible person, etc. listed in the previous text.
[0073] In addition, the parameter structure of the first derived model also includes at least one own parameter member of the first derived model. The own parameter member of the first derived model is a parameter member that directly belongs to the first derived model itself, and the own parameter member of the first derived model is not obtained indirectly through inheritance or other means.
[0074] Optionally, the own parameter members of the first derived model can be own members such as material object ID, feeding quantity, unit, material object name, material object feeding responsible person, etc., which will not be listed one by one here.
[0075] Taking the production event combined with the feeding event as an example, refer again to Figure 3 , in the model library, after creating the production event base model for the production event, if the feeding event is added during the production process, based on the production event base model, the first derived model of the production event base model can be generated, and the first derived model of the production event base model is used as the feeding event model, without the need to re-establish the base model of the feeding event, reducing resource occupation. The feeding event model inherits the parameter structure and parameter members of the production event base model. The inherited parameter members of the feeding event model include the order number, order version, and status of the production event inherited from the production event base model.
[0076] Therefore, in the embodiments of the present application, for the event activities in the production process, only need to create a base model for one of the event objects, and for other event objects, only need to create a derived model based on the base model, so that there is an association relationship between the models of different event objects, and the data of different events can be stored in the same table, which is easy to maintain.
[0077] Step S202: Based on the target base model, a running object is also generated.
[0078] After expressing the target object using the target base model, a running object can be generated through the target base model to represent the corresponding production process. Moreover, changes or expansions to the generation process can be completed based on changes to the running object. In this process, only one running object needs to be created, without creating a running object for each type of model, reducing resource occupancy.
[0079] In the embodiments of this application, when generating a running object based on the target base model:
[0080] First, a copy of the base model is generated based on the target base model.
[0081] Among them, the copy of the base model is a replication model of the target base model, and the specific parameter values of the self-owned parameter members of the target base model are represented through the copy of the base model. Each model can generate multiple model copies with the same parameter structure but different parameter values.
[0082] Then, a running object is generated based on the copy of the base model.
[0083] Among them, the configuration data of the running object is the encapsulation carrier of the model version, which records information such as the associated model ID, version, and personalized parameter values.
[0084] Continuing with the production event as an example, as Figure 3 shown, after creating the production event base model of the production event in the model library, the production event base model is copied to generate a copy of the production event base model. The parameter structure of the copy of the production event base model includes the order number, order version, status of the production event, and the parameter values of the above members. For example, the order number is 32365654475, the order version is 2, and the status is 0. Then, the copy of the production event base model is added to the real-time library, and a running object is generated based on the copy of the production event base model.
[0085] In a possible implementation, after generating the running object, second information is added to the running object based on a preset rule.
[0086] Among them, the preset rule is: after generating the running object based on the copy of the base model, multiple record information is added to the running object. For example, the object structure record information of the target base model, the object structure record information of the derived model, and other object structure record information of other models. In addition, the structure of each record information is the same as the parameter structure of the copy of the base model. Of course, the preset rule can also be to add record information such as the object structure record information of the copy of the base model and the object structure record information of the copy of the derived model to the running object. Those skilled in the art can flexibly adjust and set according to actual production requirements.
[0087] Among them, the second information includes the object structure record information of the target base model.
[0088] Continuing with the production event as an example, as Figure 3 shown, after copying the production event base model into the real-time library and generating a running object based on the copy of the production event base model, records 1, 4, and 7 of the object structure of the production event base model are added to the running object.
[0089] It should be noted that in step S202, the order of generating the first derived model and the running object can be flexibly adjusted according to actual design requirements, and this application does not make any limitations in this regard.
[0090] Step S203: Based on the first derived model, perform change processing on the running object.
[0091] The concept of a derived model is used to represent a data structure, and this structure-derived model inherits the parameter structure of the target base model that generates it. When changing and expanding the data structure, the change and expansion of the data structure of the running object can be achieved through the first derived model, without the need to create new process models and running objects, reducing the complexity of data structure change and expansion and improving system performance.
[0092] In the embodiments of this application, when performing change processing on the running object based on the first derived model:
[0093] First, perform change processing on the first derived model.
[0094] Among them, the method of change processing is to add change member information to the first derived model. The change member information can be flexibly set according to actual needs. For example, it can be set according to the feeding event, according to the work reporting event, etc. However, it should be noted that the change member information is a parameter member directly belonging to the first derived model itself.
[0095] In a possible implementation, since the first derived model inherits the parameter members of the target base model, that is, the first derived model comes with inherited parameter members. Therefore, the change member information added to the first derived model can be used as the self-owned parameter members of the first derived model. For example, the change member information can be the self-owned members such as the material object ID, feeding quantity, unit, material object name, and person in charge of material object placement mentioned above.
[0096] Then, based on the first derived model after change processing, generate a copy of the first derived model.
[0097] Exemplarily, the first derived model copy is a replication model of the first derived model, and the specific parameter values of the own parameter members and inherited parameter members of the first derived model are represented by the first derived model copy.
[0098] Next, based on a preset rule, the first information is added to the running object.
[0099] Regarding the preset rule, it has been described in detail in the foregoing method embodiments and will not be elaborated here.
[0100] Among them, the first information includes the object structure record information of the target base model and the object structure record information of the first derived model copy.
[0101] Taking the production event combined with the feeding event as an example again, as Figure 3 shown, in the model library, after generating the feeding event model, the material object ID, feeding quantity, unit, etc. of the feeding event are added to the feeding event model as its own parameter members. That is to say, the parameter structure of the feeding event model includes the order number, order version, status (i.e., the inherited parameter members of the feeding event model) of the production event, and the material object ID, feeding quantity, unit (i.e., the own parameter members of the feeding event model) of the feeding event. Then, based on the feeding event model after change processing, a feeding event model copy is generated. The parameter structure of the feeding event model copy includes the order number, order version, status of the production event, and the material object ID, feeding quantity, unit of the feeding event, as well as the parameter values of the above members. Among them, the records of the object structure of the production event base model include Record 1, Record 4, and Record 7. Taking Record 1 as an example, the order number in Record 1 is 32365654475 and the order version is 2; the records of the object structure of the production event base model copy include Record 2, Record 5, and Record 8. Taking Record 2 as an example, the order number in Record 2 is 32365698745, the order version is 2, the status is 0, the material object ID is 26444558474, the feeding quantity is 26, and the unit is ton. Finally, the feeding event model is added to the real-time library, and the records 1, 4, and 7 of the object structure of the production event base model, as well as the records 2, 5, and 8 of the object structure of the feeding event model copy, are added to the running object.
[0102] In this way, the change and expansion of the data structure are completed. The running object includes the records of both the production event base model and the feeding event model at the same time, and moreover, these record data are stored in the same table, which is easy to maintain. When inserting and querying data, only need to specify to insert and query according to a certain type of model copy, which improves the insertion and query efficiency. When expanding the production process, only need to add derived models and copies according to the base model, and the production process expansion is more convenient and fast.
[0103] Next, refer to Figure 5 , Figure 5 , which is another flowchart of the method for changing the data structure provided by the embodiment of the present application. The change method further includes the following steps:
[0104] Step S501: Create a second derived model based on the base model.
[0105] Among them, the base model includes the target base model or the first derived model. That is to say, the second derived model can be created according to the target base model, or the second derived model can be created according to the first derived model.
[0106] Exemplarily, as Figure 4 shown, taking model A as the base model, first, model C, that is, the first derived model, is created based on model A. Then, model B can be created based on model A, and model B is used as the second derived model; or, model D can also be created based on model C, and model D is used as the second derived model.
[0107] Since the second derived model is derived from the base model, the second derived model inherits the parameter members of the base model. That is to say, the parameter structure of the second derived model includes at least one inherited parameter member, where at least one inherited parameter member inherits from the own parameter members of the target base model that generates the second derived model, such as the general members of the target object such as order number, order version, order status, order ID, order responsible person, etc. mentioned above; or at least one inherited parameter member inherits from the parameter members of the first derived model that generates the second derived model, where the parameter members of the first derived model include own parameter members and inherited parameter members. For example, the own parameter members are such as the order number, order version, order status, order ID, order responsible person mentioned above; the inherited parameter members are such as the material object ID, feeding quantity, unit, material object name, material object feeding responsible person, etc. mentioned above.
[0108] Taking the production event combined with the work reporting event as an example, refer to Figure 3 again. In the model library, after creating the production event base model of the production event, if the work reporting event is added during the production process, the second derived model of the production event base model can be generated based on the production event base model, and the second derived model of the production event base model is used as the work reporting event model, without having to re-establish the base model of the work reporting event, reducing resource occupancy. The work reporting event model inherits the parameter structure and parameter members of the production event base model, and the inherited parameter members of the work reporting event model include the order number, order version, and status of the production event inherited from the production event base model.
[0109] Step S502: Perform change processing on the running object based on the second derived model.
[0110] Among them, the second information includes the object structure record information of the second derived model. Exemplarily, the object structure record information of the second derived model includes the object structure record information copied by the second derived model.
[0111] In a possible implementation, change processing is performed on the second derived model, that is, the change information about the second derived model is added to the second derived model; then, based on the second derived model after the change processing, a copy of the second derived model is generated. Next, based on a preset rule, the object structure record information of the copy of the second derived model is added to the running object. For the specific implementation method, reference can be made to the detailed description in step S203, which will not be elaborated here.
[0112] Continuing with the production event combined with the work reporting event as an example, as Figure 3 shown, in the model library, after generating the work reporting event model, work reporting information such as the work reporting date and the work reporter of the work reporting event is added to the work reporting event model as its own parameter members. That is to say, the parameter structure of the work reporting event model includes the order number, order version, and status of the production event (i.e., the inherited parameter members of the work reporting event model), as well as the work reporting date and the work reporter of the work reporting event (i.e., the own parameter members of the work reporting event model). Then, based on the work reporting event model after the change processing, a copy of the work reporting event model is generated. The parameter structure of the copy of the work reporting event model includes the order number, order version, and status of the production event, as well as the work reporting date and the work reporter of the work reporting event, and the parameter values of the above members. Among them, the records of the object structure of the production event base model include record 1, record 4, and record 7. Taking record 1 as an example, the order number in record 1 is 32365654475 and the order version is 2; the records of the object structure of the copy of the work reporting event base model include record 3, record 6, and record 9. Taking record 3 as an example, the order number in record 3 is 32366548956, the order version is 2, the status is 0, the work reporting date is 2024-01-04 20:00:00, and the work reporter is bit. Finally, the records 1, record 4, and record 7 of the object structure of the production event base model, and the records 3, record 6, and record 9 of the object structure of the copy of the work reporting event base model are added to the running object.
[0113] Therefore, in the embodiments of the present application, when expanding the production process, only the derived model and its copy need to be added according to the base model, and the production process expansion is more convenient and fast.
[0114] Next, with reference to Figure 6 , a possible data structure change process of the present invention will be introduced. Among them, Figure 6 is another process schematic diagram of the data structure change method provided by the embodiments of the present application, Figure 6Taking production events, material input events, and reporting work time as examples, the change process of the present invention is further described below.
[0115] As Figure 6 shown, a possible complete process of the change method of the present invention is as follows:
[0116] First, in the model library, the following steps are executed:
[0117] Step S601: For production events, construct a production event base model;
[0118] Step S602: Based on the production event base model, generate a copy of the production event base model;
[0119] Step S603: Add the copy of the production event base model to the real-time library;
[0120] In the real-time library, the following steps are executed:
[0121] Step S604: Based on the copy of the production event base model, generate a running object;
[0122] Step S605: Based on preset rules, add the object structure record information of the production event base model to the running object;
[0123] Next, in the model library, the following steps are executed:
[0124] Step S606: Based on the production event base model, generate a first derivative model and use the first derivative model as the material input event model;
[0125] Step S607: Add the change member information of the material input event to the material input event model to obtain the material input event model after change processing; wherein, the change member information of the material input event includes the material object ID, input quantity, and unit of the material input event
[0126] Step S608: Based on the material input event model after change processing, generate a copy of the material input event model;
[0127] Step S609: Add the copy of the material input event model to the real-time library;
[0128] In the real-time library, the following steps are executed:
[0129] Step S610: Based on preset rules, add the object structure record information of the copy of the material input event model to the running object;
[0130] Next, in the model library, the following steps are executed:
[0131] Step S611: Based on the first derivative model, generate a second derivative model and use the second derivative model as the reporting work event model;
[0132] Step S612: Add the changed member information of the reporting event to the feeding event model to obtain the reporting event model after change processing; wherein, the changed member information of the reporting event includes the reporting date and the reporter.
[0133] Step S613: Generate a copy of the reporting event model based on the reporting event model after change processing.
[0134] Step S614: Add the copy of the reporting event model to the real-time library.
[0135] In the real-time library, perform the following steps:
[0136] Step S615: Add the object structure record information of the copy of the reporting event model to the running object based on a preset rule.
[0137] It should be noted that the order of the above step processes is not fixed, and those skilled in the art can change the order of the steps or delete some steps according to needs, as long as the purpose of this application is not affected. In an alternative embodiment, a copy of the production event base model can be generated after generating the first derived model.
[0138] Based on the same inventive concept, the embodiment of this application also provides a data structure change device. The principle of this device to solve problems is similar to that of the method in the above embodiment. Therefore, the implementation of this device can refer to the implementation of the above method, and the repeated parts will not be elaborated.
[0139] See Figure 7 , Figure 7 FIG. is a schematic structural diagram of the data structure change device provided by the embodiment of this application. The data structure change device 700 includes: a construction module 701, a generation module 702, and a processing module 703.
[0140] The construction module 701 is used to construct a target base model of a target object for the target object; wherein, the corresponding parameter structure associated with the target object is defined in the target base model.
[0141] The generation module 702 is used to generate a first derived model and a running object based on the target base model.
[0142] The processing module 703 is used to perform change processing on the running object based on the first derived model.
[0143] In some implementation manners, the processing module 703 is specifically configured to perform change processing on the first derived model; generate a copy of the first derived model based on the first derived model after the change processing; add first information to the running object based on a preset rule; where the first information includes object structure record information of the target base model and object structure record information of the copy of the first derived model.
[0144] In some implementation manners, the processing module 703 is specifically configured to add changed member information to the first derived model.
[0145] In some implementation manners, the generating module 702 is further configured to create a second derived model based on the base model; where the base model includes the target base model or the first derived model.
[0146] The processing module 703 is further configured to add second information to the running object; where the second information includes object structure record information of the second derived model.
[0147] In some implementation manners, the generating module 702 is specifically configured to generate a copy of the base model based on the target base model; generate a running object based on the copy of the base model.
[0148] In some implementation manners, the processing module 703 is further configured to add third information to the running object based on a preset rule; where the third information includes object structure record information of the target base model.
[0149] In some implementation manners, the parameter structure of the target base model includes at least one base model own parameter member. The parameter structure of the derived model includes at least one derived model own parameter member and at least one inherited parameter member, where at least one inherited parameter member is inherited from the parameter members of the base model from which the derived model is generated.
[0150] Regarding the change device for the data structure in the above embodiments, the specific manners in which each module performs operations and the beneficial effects achieved have been described in detail in the foregoing method embodiments, and will not be elaborated herein.
[0151] Based on the same inventive concept as the above method embodiments, an electronic device is further provided in an embodiment of the present application. In one embodiment, the electronic device may be a server or a terminal device. In this embodiment, as Figure 8 shown, Figure 8 FIG. shows a schematic structural diagram of the electronic device. The electronic device 800 includes: a processor 801, a communication interface 802, a memory 803, and a bus 804.
[0152] Among them, the processor 801 is used to control and manage the operations of the device. For example, it executes each step in the method flow shown in the above method embodiments, and / or is used to execute other processes of the technologies described herein.
[0153] The processor 801 can implement or execute various exemplary logic blocks, units, and circuits described in connection with the disclosure of the present invention. The processor can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, units, and circuits described in connection with the disclosure of the present invention. The processor can also be a combination that implements computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0154] Among them, the communication interface 802 is used to support the communication of the device with other network entities. For example, it supports the information interaction between the electronic device 800 and other devices. The communication interface 802, the processor 801, and the memory 803 can be coupled to each other. For example, they are coupled to each other through the bus 804.
[0155] Among them, the memory 803 is used to store the program code and data of the device and is controlled by the processor 801 for execution.
[0156] The memory 803 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), or other types of dynamic storage devices that can store information and instructions. It can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 803 can exist independently and be connected to the processor 801 through the bus 804. The memory 803 can also be integrated with the processor 801.
[0157] Among them, the bus 804 may be an Extended Industry Standard Architecture (EISA) bus or the like. The bus 804 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 7 only a thick line is used to represent it in Figure 7 , but it does not mean that there is only one bus or one type of bus.
[0158] It should be noted that Figure 8 the device structure shown in Figure 8 does not constitute a limitation on the electronic device 800. Except Figure 8 for the components shown, the electronic device 800 may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0159] In actual implementation, the functions implemented by the processing unit can be Figure 8 implemented by the processor 801 shown calling the program code in the memory 803.
[0160] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0161] As described above, the embodiments of the present application can divide each execution subject involved in the method for changing the data structure into functional modules according to the above method examples. Among them, the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. In addition, it should be noted that the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation. For example, each functional module can be corresponding to each function, or two or more functions can be integrated into one processing module.
[0162] In an exemplary embodiment, the embodiments of the present application further provide a computer-readable storage medium, on which computer program instructions are stored; when the computer program instructions are executed by an electronic device, the electronic device is enabled to implement the method as described in the foregoing embodiments.
[0163] Optionally, the above computer-readable storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0164] In an exemplary embodiment, the embodiment of the present application further provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in an electronic device, the processor in the electronic device implements the method described in the foregoing embodiments.
[0165] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include common general knowledge or conventional technical means in the technical field not claimed in the present application. The specification and embodiments are only to be regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.
[0166] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A method for changing a data structure, characterized in that The method includes: For a target object, constructing a target base model of the target object; wherein, a parameter structure associated with the corresponding target object is defined in the target base model; Based on the target base model, generating a first derived model and a running object; Based on the first derived model, performing a change process on the running object.
2. The method according to claim 1, wherein The performing a change process on the running object based on the first derived model includes: Performing a change process on the first derived model; Based on the first derived model after the change process, generating a copy of the first derived model; Based on a preset rule, adding first information to the running object; wherein, the first information includes object structure record information of the target base model and object structure record information of the copy of the first derived model.
3. The method according to claim 2, wherein The performing a change process on the first derived model includes: Adding change member information to the first derived model.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Based on a base model, creating a second derived model; wherein, the base model includes the target base model or the first derived model; Based on the second derived model, performing a change process on the running object.
5. The method according to any one of claims 1 to 3, characterized in that The generating a running object based on the target base model includes: Based on the target base model, generating a copy of the base model; Based on the copy of the base model, generating the running object.
6. The method according to claim 5, wherein After generating the running object, the method further includes: Based on a preset rule, adding second information to the running object; wherein, the second information includes object structure record information of the target base model.
7. The method according to claim 4, wherein The parameter structure of the target base model includes at least one base model own parameter member; The parameter structure of a derived model includes at least one derived model own parameter member and at least one inherited parameter member, wherein, the at least one inherited parameter member inherits from the parameter members of the base model from which the derived model is generated.
8. A device for changing a data structure, characterized in that The apparatus includes: A construction module, configured to construct a target base model of a target object for the target object; wherein, a parameter structure associated with the corresponding target object is defined in the target base model; A generation module, configured to generate a first derived model and a running object based on the target base model; A processing module, configured to perform a change process on the running object based on the first derived model.
9. An electronic device, characterized in that, Includes: A processor; A memory; And a computer program; wherein, the computer program is stored on the memory, and when the computer program is executed by the processor, the electronic device implements the method according to any one of claims 1-7.
10. A computer-readable storage medium, the computer-readable storage medium comprising a computer program, characterized in that, When the computer program runs on an electronic device, the electronic device implements the method according to any one of claims 1-7.