A method, system, and readable storage medium for rapid assembly of components
By acquiring project data from the target test scenario and sending component data to the cloud platform, and utilizing dual message queues to handle component generation and power-on status, the problem of low efficiency in scenario device preparation was solved, achieving the effect of rapid component preparation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FENGTAI SCI & TECH (BEIJING) CO LTD
- Filing Date
- 2022-09-22
- Publication Date
- 2026-07-21
AI Technical Summary
In existing technologies, the preparation of scene resources for industrial control systems faces challenges such as modeling difficulties and a lack of core processing capabilities, resulting in low efficiency in scene equipment preparation.
By acquiring project data from the target test scenario, sending component data to the cloud platform to indicate generation, receiving and updating component status, and using dual message queues to handle component generation and startup status, rapid component preparation is achieved.
The ability to quickly generate components for target test scenarios at the data level improves build efficiency and reduces the probability of build failures and the presence of junk components.
Smart Images

Figure CN115481455B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and in particular relates to a method, system and readable storage medium for rapidly preparing components. Background Technology
[0002] Currently, with the continuous increase in equipment in industrial control systems, the corresponding simulation modeling is also increasing, which makes the preparation of scene resources difficult and lacks core processing, resulting in low efficiency in scene equipment preparation. Summary of the Invention
[0003] This application provides a method, system, readable storage medium, and computer program product for rapid component fabrication, which can solve the problem of low fabrication efficiency for scene devices.
[0004] In a first aspect, embodiments of this application provide a method for rapidly fabricating components, applied to electronic devices, including:
[0005] Upon receiving a preparation request from the user, the system responds to the preparation request by acquiring the first item data of the target test scenario.
[0006] Based on the first project data, obtain the first target component in the target test scenario, wherein the first target component is a component that has not been generated in the target test scenario;
[0007] Send the data of the first target component to the cloud platform, wherein the data of the first target component is used to instruct the cloud platform to generate the first target component;
[0008] Receive the preparation information returned by the cloud platform, and update the status of the first target component according to the preparation information;
[0009] The first project data includes the data of the first target component.
[0010] Optionally, the preparation information includes cloning information and first power-on information;
[0011] The step of receiving the preparation information returned by the cloud platform and updating the status of the first target component according to the preparation information includes:
[0012] After sending the data of the first target component to the clone component message queue, the system receives the cloning information returned by the clone component message queue and determines whether the first target component has been successfully cloned based on the cloning information. The cloning information is generated by the cloud platform after generating the first target component based on the data of the first target component.
[0013] If the cloning is confirmed to be successful, the corresponding first virtual identifier information is obtained, and the status of the first target component is updated to the cloning success status.
[0014] Send the first virtual identifier signal to the boot component message queue;
[0015] The system receives the first boot message returned by the boot component message queue and determines whether the first target component has successfully booted up based on the first boot message. The first boot information is generated by the cloud platform after it starts the software of the first target component based on the first virtual identifier information.
[0016] If the power-on is confirmed to be successful, the status of the first target component is updated to power-on status.
[0017] Optionally, the method further includes:
[0018] Upon receiving a user's restore request, the system responds to the restore request by acquiring the second item data of the test scenario to be restored.
[0019] Based on the second project data, obtain the second target component in the test scenario to be restored, wherein the second target component is a component that has been generated in the test scenario to be restored;
[0020] The data of the second target component is sent to the cloud platform, and the data of the second target component is used to instruct the cloud platform to restore the second target component;
[0021] Receive the restoration information returned by the cloud platform, and update the status of the second target component according to the restoration information.
[0022] Optionally, the restoration information includes recovery information and second boot information;
[0023] The step of receiving the restoration information returned by the cloud platform and updating the status of the second target component according to the restoration information includes:
[0024] After sending the data of the second target component to the recovery component message queue, the recovery information returned by the recovery component message queue is received, and the recovery information is used to determine whether the second target component has been successfully recovered. The recovery information is generated by the cloud platform after the second target component is recovered based on the data of the second target component.
[0025] If the recovery is confirmed to be successful, the corresponding second virtual identifier information is obtained, and the status of the second target component is updated to the recovery success status.
[0026] Send the second virtual identifier signal to the boot component message queue;
[0027] The system receives a second boot message returned from the boot component message queue and determines whether the second target component has successfully booted up based on the second boot message. The second boot message is generated by the cloud platform after it starts the software of the second target component based on the second virtual identifier information.
[0028] If the power-on is confirmed to be successful, the status of the second target component is updated to power-on status.
[0029] Secondly, embodiments of this application provide a method for rapidly preparing components, applied to a cloud platform, including:
[0030] Receive data from the first target component of the electronic device;
[0031] The first target component is generated based on the data of the first target component, and preparation information is returned to the electronic device, the preparation information being used to instruct the electronic device to update the state of the first target component.
[0032] Optionally, generating the first target component based on the data of the first target component and returning manufacturing information to the electronic device includes:
[0033] Data from the first target component of the electronic device is received via the clone component message queue;
[0034] The first target component is generated based on the data of the first target component, and the cloning information is returned to the electronic device through the clone component message queue;
[0035] The first virtual identifier information of the first target component of the electronic device is received through the power-on component message queue;
[0036] The software in the corresponding first target component is activated according to the first virtual identifier information, and the first boot information is returned to the electronic device through the boot component message queue.
[0037] The preparation information includes the cloning information and the first power-on information.
[0038] Optionally, the method further includes:
[0039] Receive data from a second target component of the electronic device;
[0040] The second target component is restored based on the data of the second target component, and restoration information is returned to the electronic device, the restoration information being used to instruct the electronic device to update the state of the second target component.
[0041] Optionally, the step of restoring the second target component based on the data of the second target component and returning the restoration information to the electronic device includes:
[0042] Data from the second target component of the electronic device is received via the recovery component message queue;
[0043] The second target component is restored based on the data of the second target component, and the recovery information is returned to the electronic device through the recovery component message queue;
[0044] The second virtual identifier information from the second target component of the electronic device is received through the power-on component message queue;
[0045] The software in the corresponding second target component is activated according to the second virtual identifier information, and the second boot information is returned to the electronic device through the boot component message queue.
[0046] The restoration information includes the recovery information and the second boot information.
[0047] Thirdly, embodiments of this application provide a system for rapidly preparing components, including an electronic device and a cloud platform, wherein the electronic device is electrically connected to the cloud platform;
[0048] An electronic device, used to obtain first project data of a target test scenario in response to a preparation request input by a user;
[0049] It is also used to obtain a first target component in the target test scenario based on the first project data, wherein the first target component is a component that has not been generated in the target test scenario;
[0050] It is also used to send data of the first target component to the cloud platform, wherein the first project data includes the data of the first target component;
[0051] It is also used to receive preparation information returned by the cloud platform and update the status of the first target component according to the preparation information;
[0052] A cloud platform is used to receive data from the first target component of the electronic device;
[0053] It is also used to generate the first target component based on the data of the first target component, and return the preparation information to the electronic device.
[0054] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in any one of the first or second aspects above.
[0055] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to perform the method described in any one of the first aspects above.
[0056] Sixthly, embodiments of this application provide a computer program product that, when run on a cloud platform, causes the cloud platform to execute the method described in any one of the second aspects above.
[0057] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.
[0058] The beneficial effects of the embodiments of this application compared with the prior art are:
[0059] This application embodiment obtains first project data of a target test scenario; based on the first project data, obtains a first target component in the target test scenario, wherein the first target component is a component not generated in the target test scenario; sends the data of the first target component to a cloud platform, receives preparation information returned by the cloud platform, and updates the state of the first target component based on the preparation information, thereby generating components not generated in the target test scenario and their corresponding updated states at the data level, which can quickly prepare components and improve construction efficiency. Attached Figure Description
[0060] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This is a schematic diagram of a first system provided in an embodiment of this application;
[0062] Figure 2 This is a schematic flowchart of a first embodiment of a method for rapidly preparing components provided in this application;
[0063] Figure 3 This is a schematic diagram of a second process for a method of rapidly preparing components according to an embodiment of this application;
[0064] Figure 4 This is a schematic diagram of a second system provided in an embodiment of this application;
[0065] Figure 5 This is a schematic diagram of a third process for a rapid component preparation method provided in an embodiment of this application;
[0066] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0067] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0068] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0069] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0070] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0071] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0072] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0073] Figure 1 This is a schematic diagram of the first system provided in an embodiment of this application. For example... Figure 1 As shown, the system includes an electronic device 10 and a cloud platform 20, with the electronic device 10 and the cloud platform 20 being electrically connected.
[0074] Electronic device 10 is used to, upon receiving a preparation request input by a user, acquire first project data of a target test scenario in response to the preparation request, the first project data including data of a first target component;
[0075] It is also used to obtain the first target component in the target test scenario based on the first project data. The first target component is a component that has not been generated in the target test scenario.
[0076] It is also used to send data of the first target component to the cloud platform 20;
[0077] It is also used to receive preparation information returned by the cloud platform 20 and update the status of the first target component based on the preparation information.
[0078] In the application, the electronic device is equipped with a front-end application for receiving user input requests, a back-end application for processing requests, and a database for storing data. This database includes data from all test scenarios, such as user information, component data, and virtualization connection information. Once a component is generated, its data contains corresponding identification information.
[0079] After receiving a preparation request, the front-end application sends a preparation request to the back-end application. The back-end application receives the preparation request and, in response, retrieves the first project data from the database. Based on the first scenario information in the first project data, it obtains all components in the target test scenario; based on the first identifier information in the first project data, it filters the generated components to obtain the first target component. After sending the data of the first target component to the cloud platform, it receives the preparation information returned by the cloud platform and parses the preparation information; when it is determined that the first target component has been successfully prepared based on the preparation information, it updates the status of the first target component in the database to indicate that the first target component has been successfully prepared.
[0080] Cloud platform 20 is used to receive data from the first target component of electronic device 10;
[0081] It is also used to generate the first target component based on the data of the first target component and return the preparation information to the electronic device 10.
[0082] In the application, the cloud platform receives data from the first target component, creates the corresponding first target component based on the data, starts the simulation software in the first target component to prepare the component, and then returns the preparation information to the electronic device.
[0083] Generally, a test environment needs to be built before component preparation. The specific process involves creating a business component within the test environment on the cloud platform and running the relevant simulation software within that component. Once the business component is ready, it is converted into a component template for subsequent addition. After adding the business component, a network component is added; the network address and gateway information of the business component are set according to the network topology; the business component connects to physical devices through the network component. Simultaneously, network isolation is achieved for different test environments using virtual bridge components and tags.
[0084] In this embodiment, rapid component fabrication is achieved, improving build efficiency while also providing responsiveness. Furthermore, component fabrication is performed at the data level, enabling continued component fabrication within an already generated test environment.
[0085] This embodiment uses an electronic device to obtain a first target component in the target test scenario based on the first project data. The first target component is a component that has not been generated in the target test scenario. The device sends the data of the first target component to the cloud platform, receives the preparation information returned by the cloud platform, and updates the status of the first target component according to the preparation information. The cloud platform receives the data of the first target component from the electronic device, generates the first target component based on the data of the first target component, and returns the preparation information to the electronic device. By generating the component that has not been generated in the target test scenario and its corresponding updated status at the data level, the device can quickly prepare components and improve the construction efficiency.
[0086] Corresponding to the system described in the above embodiments, only the parts related to the embodiments of this application are shown for ease of explanation.
[0087] Figure 2 This is a schematic flowchart of a first embodiment of a method for rapidly preparing components provided in this application. For example... Figure 2 As shown, the method includes methods applied to electronic devices and methods applied to cloud platforms.
[0088] Methods applied to electronic devices include:
[0089] S11: After receiving the preparation request from the user, in response to the preparation request, obtain the first item data of the target test scenario.
[0090] The first project data includes data of the first target component, data of the components already generated in the target test scenario, and first scenario data. The data of the generated components includes first identification information used to characterize the generated components, and the first scenario data is scenario information of the target test scenario.
[0091] In the application, the front-end application receives the preparation request, and the back-end application responds to the preparation request by retrieving the first item data of the target test scenario from the database.
[0092] S12: Based on the data from the first project, obtain the first target component in the target test scenario.
[0093] The first target component is the component that was not generated in the target test scenario.
[0094] In the application, the backend application obtains all components in the target test scenario based on the first scenario information; and filters the generated components in the target test scenario based on the first identifier information to obtain the first target component.
[0095] S13: Send the data of the first target component to the cloud platform.
[0096] The data of the first target component is used to instruct the cloud platform to generate the first target component.
[0097] In the application, the backend application sends the data of the first target component to the cloud platform to call the cloud platform interface to prepare the first target component.
[0098] S14: Receive the preparation information returned by the cloud platform and update the status of the first target component according to the preparation information.
[0099] In application, the preparation information includes the preparation results. The status of the first target component in the database is updated based on the preparation results to characterize the successful preparation of the first target component.
[0100] Methods applied to cloud platforms include:
[0101] S21: Receive data from the first target component of the electronic device.
[0102] S22: Generate the first target component based on the data of the first target component, and return the preparation information to the electronic device.
[0103] The preparation information is used to instruct the electronic device to update the state of the first target component.
[0104] This embodiment acquires first project data of a target test scenario; based on the first project data, it acquires a first target component in the target test scenario, where the first target component is a component not yet generated in the target test scenario; it sends the data of the first target component to a cloud platform, receives preparation information returned by the cloud platform, and updates the state of the first target component based on the preparation information. The cloud platform generates the first target component based on the data of the first target component and returns preparation information to the electronic device. This data-level generation of components not yet generated in the target test scenario and their corresponding updated states enables rapid component preparation and improves construction efficiency.
[0105] In one embodiment, once a test scenario is generated, testing and experimentation are performed. After completion, the user can restore the system to their desired test environment by restoring the components.
[0106] Figure 3 This is a schematic diagram of a second process for a rapid component preparation method provided in an embodiment of this application.
[0107] like Figure 3 As shown:
[0108] Methods applied to electronic devices also include:
[0109] S15: Upon receiving a user's input request for restoration, respond to the restoration request by obtaining the second item data of the test scenario to be restored.
[0110] The second project data includes data of the second target component, data of components not generated in the test scenario to be restored, and second scenario data. The data of the second target component includes second identification information used to characterize the generated components, and the second scenario data is scenario information of the test scenario to be restored.
[0111] In the application, the front-end application receives the restore request, and the back-end application responds to the restore request by retrieving the second item data from the database.
[0112] S16: Based on the data from the second project, obtain the second target component in the test scenario to be restored.
[0113] The second target component is the component that has already been generated in the test scenario to be restored.
[0114] In the application, the backend application obtains all components in the test scenario to be restored based on the second scenario data; and obtains the second target component based on the second identification information.
[0115] S17: Send data of the second target component to the cloud platform.
[0116] The data from the second target component is used to instruct the cloud platform to restore the second target component.
[0117] In the application, the backend application sends data of the second target component to the cloud platform to call the cloud platform interface to restore the second target component.
[0118] S18: Receive the restoration information returned by the cloud platform and update the status of the second target component according to the restoration information.
[0119] In the application, the restoration information includes the restoration result. The state of the second target component in the database is updated based on the restoration result to indicate whether the second target component has been successfully restored and whether the test scenario to be restored has been successfully restored.
[0120] Methods applied to cloud platforms also include:
[0121] S23: Receive data from the second target component of the electronic device.
[0122] S24: Restore the second target component based on the data of the second target component, and return the restoration information to the electronic device.
[0123] The restoration information is used to instruct the electronic device to update the status of the second target component.
[0124] In the application, the cloud platform receives data from the second target component, creates a corresponding second target component based on the data, starts the simulation software in the second target component to restore the component, and then returns the restoration information to the electronic device.
[0125] This embodiment uses an electronic device to obtain the second target component in the test scenario to be restored based on the second project data; sends the data of the second target component to the cloud platform, receives the restoration information returned by the cloud platform, and updates the status of the second target component according to the restoration information. The cloud platform restores the second target component based on the data of the second target component and returns the restoration information to the electronic device. At the data level, it restores the components already generated in the test scenario to be restored and their corresponding updated status, which can quickly restore the test scenario and reduce the probability of component building failure and residual garbage components.
[0126] Figure 4 This is a schematic diagram of a second system provided in one embodiment of this application. For example... Figure 4 As shown, the electronic device 10 in the system communicates with the cloud platform 20 through the message queue 30.
[0127] Electronic device 10 is used to receive cloning information returned by the cloning component message queue after sending data of the first target component to the cloning component message queue, and to determine whether the first target component has been successfully cloned based on the cloning information.
[0128] It is also used to obtain the corresponding first virtual identifier information and update the status of the first target component to the cloned state if the cloning is determined to be successful.
[0129] It is also used to send the first virtual identifier signal to the boot component message queue;
[0130] It is also used to receive the first boot message returned by the boot component message queue, and to determine whether the first target component has successfully booted up based on the first boot message;
[0131] It is also used to update the state of the first target component to the powered-on state if the boot is confirmed to be successful.
[0132] The preparation information includes cloning information and initial startup information.
[0133] In the application, after receiving the cloning information, the backend application parses it. The cloning information is transmitted in XML (Extensible Markup Language) format. The backend application determines whether the cloning was successful based on the cloning result in the XML file. If the cloning is successful, it obtains the first virtual identifier information representing the generated virtual component from the XML file and updates the status of the first target component in the database to the successful cloning status. The backend application also receives and parses the first boot information. The first boot information is transmitted in XML format. The backend application determines whether the boot process was successful based on the boot result in the XML file. If the boot process was successful, it updates the status of the first target component in the database to the boot state.
[0134] Cloud platform 20 is used to receive data from the first target component of electronic device 10 via clone component message queue;
[0135] It is also used to generate the first target component based on the data of the first target component, and to return the cloning information to the electronic device 10 through the clone component message queue;
[0136] It is also used to receive first virtual identifier information from the first target component of the electronic device 10 through the power-on component message queue;
[0137] It is also used to open the software in the corresponding first target component according to the first virtual identifier information, and return the first boot information to the electronic device 10 through the boot component message queue.
[0138] In the application, the cloud platform obtains the data of the first target component from the clone component message queue. Based on the data of the first target component, it creates the first target data. After creation, it generates clone information and sends the clone information to the clone component message queue. The cloud platform obtains the first virtual identifier information from the boot component message queue, maps the first virtual identifier information to the first target component, locates the corresponding first target component, and starts the simulation software.
[0139] This embodiment uses dual message queues to process the generation and power-on of the first target component, further shortening the component preparation time and improving efficiency.
[0140] Corresponding to the system described in the above embodiments, only the parts related to the embodiments of this application are shown for ease of explanation.
[0141] Figure 5 This is a schematic diagram of the third process of a method for rapidly preparing components according to an embodiment of this application.
[0142] like Figure 5 As shown, step S14 includes:
[0143] S141: After sending the data of the first target component to the clone component message queue, receive the clone information returned by the clone component message queue, and determine whether the first target component has been successfully cloned based on the clone information.
[0144] In application, if the value of the cloning result in the cloning information is a first preset value, the first target component is determined to have been successfully cloned. If the value of the cloning result is a second preset value, the first target component is determined to have failed to be cloned.
[0145] S142: If the cloning is successful, obtain the corresponding first virtual identifier information and update the status of the first target component to the cloning success status.
[0146] In the application, if cloning is successful, the first virtual identifier information is obtained from the cloning information, and the status of the first target component in the database is updated.
[0147] S143: Send the first virtual identifier signal to the boot component message queue.
[0148] S144: Receive the first boot message returned by the boot component message queue, and determine whether the first target component has successfully booted up based on the first boot message.
[0149] In the application, if the boot result value in the first boot message is a first preset value, the first target component is determined to have booted successfully. If the boot result value is a second preset value, the first target component is determined to have booted unsuccessfully.
[0150] S145: If the power-on is confirmed to be successful, update the status of the first target component to the power-on status.
[0151] Step S22 includes:
[0152] S221: Receive data from the first target component of the electronic device via the clone component message queue.
[0153] S222: Generate the first target component based on the data of the first target component, and return the cloning information to the electronic device through the clone component message queue.
[0154] In the application, if the generation is successful, the value of the cloning result in the cloning information will be set to the first preset value. If the generation fails, the value of the cloning result will be set to the second preset value.
[0155] Once the first target component is generated, corresponding identification information is generated, which can be used to represent that the first target component has been generated, i.e., the first virtual identification information, and is stored in the clone information.
[0156] S223: Receive the first virtual identifier information from the first target component of the electronic device through the power-on component message queue.
[0157] S224: The software in the corresponding first target component is started according to the first virtual identifier information, and the first boot information is returned to the electronic device through the boot component message queue.
[0158] In the application, if the power-on is successful, the value of the power-on result in the first power-on message is set to the first preset value. If the power-on fails, the value of the power-on result is set to the second preset value.
[0159] In one embodiment, step S18 includes:
[0160] S181: After sending the data of the second target component to the recovery component message queue, receive the recovery information returned by the recovery component message queue, and determine whether the second target component has been successfully recovered based on the recovery information.
[0161] In the application, if the recovery result value in the recovery information is the first preset value, the second target component is determined to have been successfully recovered. If the recovery result value is the second preset value, the second target component is determined to have failed to recover.
[0162] S182: If the recovery is successful, obtain the corresponding second virtual identifier information and update the status of the second target component to the recovery success status.
[0163] In the application, after confirming successful recovery, the second virtual identifier information corresponding to the second target component is retrieved from the database, and the status of the second target component in the database is updated to the successful recovery status.
[0164] S183: Send a second virtual identifier signal to the boot component message queue.
[0165] S184: Receive the second boot message returned by the boot component message queue, and determine whether the second target component has successfully booted up based on the second boot message.
[0166] In the application, if the boot result value of the second boot message is the first preset value, the second target component is determined to have booted successfully. If the boot result value is the second preset value, the second target component is determined to have failed to boot.
[0167] S185: If the boot process is confirmed to be successful, update the status of the second target component to boot status.
[0168] The restored information includes recovery information and second boot information.
[0169] Step S24 includes:
[0170] S241: Receive data from the second target component of the electronic device via the recovery component message queue.
[0171] S242: Restore the second target component based on the data of the second target component, and return the recovery information to the electronic device through the recovery component message queue.
[0172] In the application, if the recovery is successful, the value of the recovery result in the recovery information will be set to the first preset value. If the recovery fails, the value of the recovery result will be set to the second preset value.
[0173] S243: Receive second virtual identifier information from the second target component of the electronic device through the power-on component message queue.
[0174] S244: The software in the corresponding second target component is started according to the second virtual identifier information, and the second boot information is returned to the electronic device through the boot component message queue.
[0175] In the application, if the power-on is successful, the value of the power-on result in the second power-on information is set to the first preset value. If the power-on fails, the value of the power-on result is set to the second preset value.
[0176] This embodiment uses dual message queues to process the recovery and boot of the second target component, further shortening the recovery time and improving the efficiency of the recovery test scenario.
[0177] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0178] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device 10 of this embodiment includes: at least one processor 11 ( Figure 6 (Only one is shown in the diagram), memory 12, and computer program 13 stored in said memory 12 and executable on said at least one processor 11, which, when executed by said processor 11, implements the steps in any of the above method embodiments.
[0179] The electronic device 10 can be a desktop computer, laptop, handheld computer, or other computing device. The electronic device 10 may include, but is not limited to, a processor 11 and a memory 12. Those skilled in the art will understand that... Figure 6This is merely an example of electronic device 10 and does not constitute a limitation on electronic device 10. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0180] The processor 11 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0181] In some embodiments, the memory 12 may be an internal storage unit of the electronic device 10, such as a hard disk or memory of the electronic device 10. In other embodiments, the memory 12 may be an external storage device of the electronic device 10, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 10. Furthermore, the memory 12 may include both internal and external storage units of the electronic device 10. The memory 12 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 12 can also be used to temporarily store data that has been output or will be output.
[0182] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0183] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0184] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the above-described method embodiments.
[0185] This application provides a computer program product that, when run on an electronic device, enables the electronic device to implement the steps described above in the method embodiment applied to the electronic device.
[0186] This application provides a computer program product that, when run on a cloud platform, enables the cloud platform to implement the steps described in the method embodiment of the application cloud platform.
[0187] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0188] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0189] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0190] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0191] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0192] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for rapidly preparing components, characterized in that, Applied to electronic devices, including: Upon receiving a preparation request from the user, the system responds to the preparation request by acquiring the first item data of the target test scenario. Based on the first project data, obtain the first target component in the target test scenario, wherein the first target component is a component that has not been generated in the target test scenario; Send the data of the first target component to the cloud platform, wherein the data of the first target component is used to instruct the cloud platform to generate the first target component; Receive the preparation information returned by the cloud platform, and update the status of the first target component according to the preparation information; Upon receiving a user's restore request, the system responds to the restore request by acquiring the second item data of the test scenario to be restored. Receive the restoration information returned by the cloud platform, and update the status of the second target component according to the restoration information; The first project data includes the data of the first target component; The preparation information includes cloning information and first power-on information. Receiving the preparation information returned by the cloud platform and updating the status of the first target component based on the preparation information includes: If the cloning is confirmed to be successful, then update the status of the first target component to the status of successful cloning. If the power-on is confirmed to be successful, then update the status of the first target component to the power-on status; The restoration information includes recovery information and second boot information. Receiving the restoration information returned by the cloud platform and updating the status of the second target component based on the restoration information includes: If the recovery is confirmed to be successful, then update the status of the second target component to the successful recovery status; If the power-on is confirmed to be successful, the status of the second target component is updated to power-on status.
2. The method as described in claim 1, characterized in that: The step of receiving the preparation information returned by the cloud platform and updating the status of the first target component according to the preparation information includes: After sending the data of the first target component to the clone component message queue, the system receives the cloning information returned by the clone component message queue and determines whether the first target component has been successfully cloned based on the cloning information. The cloning information is generated by the cloud platform after generating the first target component based on the data of the first target component. If the cloning is confirmed to be successful, the corresponding first virtual identifier information is obtained; Send the first virtual identifier signal to the boot component message queue; The system receives a first boot message returned from the boot component message queue and determines whether the first target component has successfully booted up based on the first boot message. The first boot information is generated by the cloud platform after it starts the software of the first target component based on the first virtual identifier information.
3. The method as described in claim 1 or 2, characterized in that, Also includes: Based on the second project data, obtain the second target component in the test scenario to be restored, wherein the second target component is a component that has been generated in the test scenario to be restored; The data of the second target component is sent to the cloud platform, and the data of the second target component is used to instruct the cloud platform to restore the second target component.
4. The method as described in claim 3, characterized in that: The step of receiving the restoration information returned by the cloud platform and updating the status of the second target component according to the restoration information includes: After sending the data of the second target component to the recovery component message queue, the recovery information returned by the recovery component message queue is received, and the recovery information is used to determine whether the second target component has been successfully recovered. The recovery information is generated by the cloud platform after the second target component is recovered based on the data of the second target component. If the recovery is confirmed to be successful, the corresponding second virtual identifier information is obtained; Send a second virtual identifier signal to the boot component message queue; The system receives a second boot message returned from the boot component message queue and determines whether the second target component has successfully booted up based on the second boot message. The second boot message is generated by the cloud platform after it starts the software of the second target component based on the second virtual identifier information.
5. A method for rapidly preparing components, characterized in that, Applied to cloud platforms, including: Receive data from the first target component of the electronic device; The first target component is generated based on the data of the first target component, and preparation information is returned to the electronic device, wherein the preparation information is used to instruct the electronic device to update the state of the first target component; Receive data from a second target component of the electronic device; The second target component is restored based on the data of the second target component, and restoration information is returned to the electronic device, the restoration information being used to instruct the electronic device to update the state of the second target component; The electronic device communicates with the cloud platform via a message queue. The preparation information includes cloning information and first power-on information, and the restoration information includes recovery information and second power-on information.
6. The method as described in claim 5, characterized in that, The step of generating the first target component based on the data of the first target component and returning manufacturing information to the electronic device includes: The first target component is generated based on the data of the first target component, and the cloning information is returned to the electronic device through the clone component message queue; The first virtual identifier information of the first target component of the electronic device is received through the power-on component message queue; The software in the corresponding first target component is activated based on the first virtual identifier information, and the first boot information is returned to the electronic device through the boot component message queue.
7. The method as described in claim 5, characterized in that, The step of restoring the second target component based on the data of the second target component and returning the restoration information to the electronic device includes: Data from the second target component of the electronic device is received via the recovery component message queue; The second target component is restored based on the data of the second target component, and the recovery information is returned to the electronic device through the recovery component message queue; The second virtual identifier information from the second target component of the electronic device is received through the power-on component message queue; The software in the corresponding second target component is activated according to the second virtual identifier information, and the second boot information is returned to the electronic device through the boot component message queue.
8. A system for rapidly preparing components, characterized in that, It includes an electronic device and a cloud platform, wherein the electronic device is electrically connected to the cloud platform and communicates with the cloud platform through a message queue; An electronic device, used to obtain first project data of a target test scenario in response to a preparation request input by a user; It is also used to obtain a first target component in the target test scenario based on the first project data, wherein the first target component is a component that has not been generated in the target test scenario; It is also used to send data of the first target component to the cloud platform, wherein the first project data includes the data of the first target component; It is also used to receive preparation information returned by the cloud platform and update the status of the first target component according to the preparation information; It is also used to, upon receiving a user's input restoration request, respond to the restoration request and obtain the second item data of the test scenario to be restored; It is also used to receive restoration information returned by the cloud platform and update the status of the second target component according to the restoration information; The preparation information includes cloning information and first power-on information, and the restoration information includes recovery information and second power-on information; An electronic device, specifically used to update the state of the first target component to a successful cloning state if it is determined that cloning is successful; Specifically, if it is determined that the power-on is successful, the state of the first target component is updated to the power-on state; Specifically, if the recovery is determined to be successful, the status of the second target component is updated to a successful recovery status; Specifically, if the power-on is confirmed to be successful, the status of the second target component is updated to the power-on status; A cloud platform is used to receive data from the first target component of the electronic device; It is also used to generate the first target component based on the data of the first target component, and return the manufacturing information to the electronic device; It is also used to receive data from a second target component of the electronic device; It is also used to restore the second target component based on the data of the second target component, and return restoration information to the electronic device, the restoration information being used to instruct the electronic device to update the state of the second target component.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 4 or claims 5 to 7.