Energy Internet Marketing Service System Data Synchronization Iteration Method, Device and Storage Medium

By adopting a synchronous iteration method in the energy Internet marketing service system, the update package data of applets and APPs is resolved, the problem of inconsistent functions after update is solved, the user experience is improved and the manpower testing needs are reduced.

CN119376783BActive Publication Date: 2025-05-06NORTH CHINA GRID MEASUREMENT CENT +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411474563.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-05-06
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

In the prior art, there may be inconsistent functions of mini programs and APPs after updates, resulting in the impact of user experience. The prior art relies on a large amount of manpower for manual testing, which is time-consuming and labor-intensive and incomplete.

Method used

A synchronous iteration method of energy Internet marketing service system data is proposed. By obtaining the update packages of mini-programs and APPs, the corresponding data information is obtained, matching and searching for differences, and determining the consistency of functions based on differences, and if consistent, synchronous iteration update is performed.

Benefits of technology

Ensure that the functions of mini programs and APPs remain synchronized after update, improve user experience, and reduce the need for manpower testing, achieving fast, accurate, safe and reliable judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376783B_ABST
    Figure CN119376783B_ABST
Patent Text Reader

Abstract

This invention proposes a method, apparatus, and storage medium for synchronous iteration of data in an energy internet marketing service system. The method includes: acquiring update packages for an energy sales mini-program and an app, respectively, where the mini-program's update package is a first update package and the app's update package is a second update package; parsing the first and second update packages to obtain first parsed data information and second parsed data information, respectively; matching the first and second parsed data information to find differences between them, and determining the functional consistency of the first and second update packages based on these differences; if consistent, then using the first and second update packages to synchronously iterate and update the energy sales mini-program and app respectively based on a set trigger time point. This invention solves the defect of inconsistent functionality between the mini-program and app after updates, improving customer experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer big data processing, and in particular to a method, device and storage medium for synchronous iteration of energy Internet marketing service system data. Background Art

[0002] In the prior art, in order to facilitate user use, there are two versions of the program, namely, the mini program and the APP, that is, users can use the mini program or the APP to perform corresponding operations. Since the mini program and the APP may be maintained and updated by different developers during the maintenance process, this will lead to inconsistencies in the functions of the updated mini program and the APP, affecting the user experience. In the prior art, a large amount of manpower is generally used to manually test the mini program and the APP to be updated, which is time-consuming and labor-intensive, and the testing is not comprehensive. It is a technical challenge to accurately, quickly, safely and reliably determine whether the functions of the mini program and the APP are consistent after the update. Summary of the invention

[0003] The present invention proposes the following technical solutions to address one or more technical deficiencies in the above-mentioned prior art.

[0004] A synchronous iteration method for energy internet marketing service system data, wherein the energy internet marketing service system includes an energy sales applet and an APP, and the method includes:

[0005] An acquisition step of acquiring update packages of the energy sales applet and the APP respectively, wherein the update package of the applet is a first update package, and the update package of the APP is a second update package;

[0006] A parsing step of parsing the first update package and the second update package to obtain first parsed data information and second parsed data information respectively;

[0007] A synchronous iteration step is to match the first parsed data information and the second parsed data information, find the differences between the first parsed data information and the second parsed data information, and judge the functional consistency of the first update package and the second update package based on the differences. If yes, use the first update package and the second update package to perform synchronous iterative updates on the energy sales applet and APP respectively based on the set trigger time point.

[0008] Furthermore, the operation of finding the difference between the first parsed data information and the second parsed data information is: mapping the first parsed data to a first DOM tree, and using a first data structure to store the first DOM tree; mapping the second parsed data to a second DOM tree, and using a second data structure to store the second DOM tree; comparing whether the composition structures of the first data structure and the second data structure are consistent, if yes, comparing the composition objects of the first data structure and the second data structure to determine the difference; if no, taking the part with different composition structures as the difference.

[0009] Furthermore, the first data structure and the second data structure are graph data structures.

[0010] Furthermore, the operation of determining the functional consistency of the first update package and the second update package based on the difference point is: decompiling the first update package and the second update package into corresponding first assembly language codes and second assembly language codes, respectively; determining the difference code in the first assembly language code and the second assembly language code based on the difference point, and encapsulating the difference code in the first assembly language code and the second assembly language code into a first independent function and a second independent function, respectively; testing the first and second independent functions using multiple test variables, if the output results of the first and second independent functions are consistent, then it is considered that the functions of the first update package and the second update package are consistent, otherwise, they are not consistent.

[0011] Furthermore, the operation of encapsulating the difference code in the first assembly language code and the second assembly language code into the first independent function and the second independent function respectively is: respectively counting the number of variables and the number of code lines in the first assembly language code and the second assembly language code, respectively setting the first memory space and the second memory space in the memory based on the number of variables and the number of code lines in the first assembly language code and the second assembly language code, respectively loading the first assembly language code and the second assembly language code into the first memory space and the second memory space respectively, encapsulating the difference code in the first code into the first independent function in the first memory space, and encapsulating the difference code in the second code into the second independent function in the second memory space, wherein the physical addresses of the first memory space and the second memory space do not overlap.

[0012] Furthermore, the operation of using multiple test variables to test the first and second independent functions is: using multiple test variables in the first memory space to test the first independent function, and saving the test results in a first test vector, using the same multiple test variables in the second memory space to test the second independent function, and saving the test results in a second test vector, and judging whether the output results are consistent based on the first test vector and the second test vector.

[0013] Furthermore, the operation of setting the first memory space and the second memory space in the memory based on the number of variables and the number of code lines in the first assembly language code and the second assembly language code is:

[0014]

[0015] Among them, Mspace1 and Mspace2 represent the size of the first and second memory spaces respectively, varnum1 and varnum2 represent the number of variables in the first and second assembly language codes respectively, linenum1 and linenum2 represent the number of code lines in the first and second assembly language codes respectively, and packet q , packet2 represent the size of the first and second update packets respectively.

[0016] The present invention also proposes a synchronous iteration device for energy internet marketing service system data, wherein the energy internet marketing service system includes an energy sales applet and an APP, and the device includes:

[0017] An acquisition unit, respectively acquiring update packages of the energy sales applet and the APP, wherein the update package of the applet is a first update package, and the update package of the APP is a second update package;

[0018] A parsing unit, parsing the first update package and the second update package to obtain first parsed data information and second parsed data information respectively;

[0019] The synchronous iteration unit matches the first parsed data information and the second parsed data information, searches for differences between the first parsed data information and the second parsed data information, and determines the functional consistency of the first update package and the second update package based on the differences. If yes, the energy sales applet and the APP are synchronously iterated and updated respectively using the first update package and the second update package based on the set trigger time point.

[0020] Furthermore, the operation of finding the difference between the first parsed data information and the second parsed data information is: mapping the first parsed data to a first DOM tree, and using a first data structure to store the first DOM tree; mapping the second parsed data to a second DOM tree, and using a second data structure to store the second DOM tree; comparing whether the composition structures of the first data structure and the second data structure are consistent, if yes, comparing the composition objects of the first data structure and the second data structure to determine the difference; if no, taking the part with different composition structures as the difference.

[0021] Furthermore, the first data structure and the second data structure are graph data structures.

[0022] Furthermore, the operation of determining the functional consistency of the first update package and the second update package based on the difference point is: decompiling the first update package and the second update package into corresponding first assembly language codes and second assembly language codes, respectively; determining the difference code in the first assembly language code and the second assembly language code based on the difference point, and encapsulating the difference code in the first assembly language code and the second assembly language code into a first independent function and a second independent function, respectively; testing the first and second independent functions using multiple test variables, if the output results of the first and second independent functions are consistent, then it is considered that the functions of the first update package and the second update package are consistent, otherwise, they are not consistent.

[0023] Furthermore, the operation of using multiple test variables to test the first and second independent functions is: using multiple test variables in the first memory space to test the first independent function, and saving the test results in a first test vector, using the same multiple test variables in the second memory space to test the second independent function, and saving the test results in a second test vector, and judging whether the output results are consistent based on the first test vector and the second test vector.

[0024] Furthermore, the operation of setting the first memory space and the second memory space in the memory based on the number of variables and the number of code lines in the first assembly language code and the second assembly language code is:

[0025]

[0026] Among them, Mspace1 and Mspace2 respectively represent the sizes of the first and second memory spaces, varnum1 and varnum2 respectively represent the number of variables in the first and second assembly language codes, linenum1 and linenum2 respectively represent the number of code lines in the first and second assembly language codes, and packet1 and packet2 respectively represent the sizes of the first and second update packages.

[0027] The present invention further provides a computer-readable storage medium, wherein the storage medium stores computer program code, and when the computer program code is executed by a computer, any of the above methods is executed.

[0028] The technical effect of the present invention is: a method, device and storage medium for synchronous iteration of data of an energy Internet marketing service system of the present invention, the energy Internet marketing service system includes an energy sales applet and an APP, the method includes: an acquisition step S101, respectively acquiring update packages of the energy sales applet and the APP, the update package of the applet is the first update package, and the update package of the APP is the second update package; a parsing step S102, parsing the first update package and the second update package to obtain first parsed data information and second parsed data information respectively; a synchronous iteration step S103, matching the first parsed data information and the second parsed data information, finding the difference between the first parsed data information and the second parsed data information, and judging the functional consistency of the first update package and the second update package based on the difference, if so, using the first update package and the second update package based on the set trigger time point to perform synchronous iterative updates on the energy sales applet and the APP respectively. In the present invention, in order to solve the defect of inconsistent functions between the mini program and the APP after update, the first update package and the second update package of the mini program and the APP are parsed respectively to obtain corresponding first parsed data information and second parsed data information; then the first parsed data information and the second parsed data information are matched to find the difference between the first parsed data information and the second parsed data information, and the functional consistency of the first update package and the second update package is judged based on the difference. If so, the energy sales mini program and the APP are synchronously iterated and updated respectively using the first update package and the second update package based on the set trigger time point.That is, in the present invention, matching is performed based on the parsed data of the update packages of the mini-program and the APP to determine the differences, and based on the differences, it is determined whether the functions of the update packages of the mini-program and the APP are consistent, thereby ensuring that the functions of the updated mini-program and the APP remain synchronized, thereby improving the customer experience; in the present invention, in order to solve the matching difficulties caused by the different development languages ​​of the mini-program and the APP, the present invention creatively converts the parsed data of the mini-program and the APP into corresponding DOM trees, and stores the DOM trees in a graph data structure, that is, converting the DOM tree into a graph structure, so that the differences can be quickly located, that is, in the present invention, by comparing whether the composition structures of the first data structure and the second data structure are consistent, if so, the composition objects of the first data structure and the second data structure are compared to determine the differences; if not, the parts with different composition structures are used as differences, thereby the present invention forms a two-dimensional matching method of composition structure->composition object, thereby improving the efficiency of determining the differences; in the present invention, in order to ensure the accuracy of independent function testing, based The first memory space and the second memory space are set in the memory according to the number of variables and the number of code lines in the first assembly language code and the second assembly language code, the first assembly language code and the second assembly language code are loaded in the first memory space and the second memory space respectively, the difference code in the first code is encapsulated as a first independent function in the first memory space, and the difference code in the second code is encapsulated as a second independent function in the second memory space. That is, in the present invention, two independent functions are constructed in independent memory spaces, so as to prevent the two assembly language codes after decompilation from easily causing variable misreferences in the same memory space, thereby ensuring that the judgment result of the consistency of functions of the mini program and the APP update package is reliable; the present invention designs a specific formula for presetting the corresponding memory space based on the running characteristics and code characteristics of the mini program and the APP. Since the mini program is a host program, although its code is relatively small, the memory space occupied by it during operation is larger than that of the APP. Therefore, when opening up the corresponding memory space, it is adopted for the mini program. As the parameters are consistent, and for APP, use As one of the parameters, it ensures that no memory leaks or memory overflow errors occur during the corresponding independent function testing process, thus ensuring the reliability of the test results. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Other features, objects and advantages of the present application will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings.

[0030] Figure 1 It is a flow chart of a method for synchronous iteration of energy Internet marketing service system data according to an embodiment of the present invention.

[0031] Figure 2It is a structural diagram of a synchronous iteration device for energy Internet marketing service system data according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0033] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0034] Figure 1 A synchronous iteration method of energy internet marketing service system data of the present invention is shown, wherein the energy internet marketing service system includes an energy sales applet and an APP, and the method includes:

[0035] Acquisition step S101, respectively acquiring update packages of the energy sales applet and the APP, wherein the update package of the applet is a first update package, and the update package of the APP is a second update package;

[0036] Parsing step S102, parsing the first update package and the second update package to obtain first parsed data information and second parsed data information respectively;

[0037] The synchronous iteration step S103 matches the first parsed data information and the second parsed data information, finds the differences between the first parsed data information and the second parsed data information, and judges the functional consistency of the first update package and the second update package based on the differences. If yes, the energy sales applet and the APP are synchronously iterated and updated respectively using the first update package and the second update package based on the set trigger time point.

[0038] The applet in the present invention refers to a program that runs on other platforms and cannot run independently, such as the applet running in WeChat and Alipay. APP refers to a program that can be installed on a computer, mobile phone, tablet computer and other hardware devices and can run independently. The energy sales in the present invention refer to the sale of electricity, but of course it can also refer to the sale of other types of energy such as oil and natural gas.

[0039] In the present invention, in order to solve the defect of inconsistent functions between the mini program and the APP after update, the first update package and the second update package of the mini program and the APP are parsed respectively to obtain the corresponding first parsed data information and the second parsed data information; then the first parsed data information and the second parsed data information are matched, the difference between the first parsed data information and the second parsed data information are found, and the functional consistency of the first update package and the second update package is judged based on the difference. If yes, the energy sales mini program and the APP are synchronously iteratively updated respectively using the first update package and the second update package based on the set trigger time point. That is, in the present invention, the data after parsing the update packages of the mini program and the APP are matched to determine the difference, and based on the difference, it is determined whether the functions of the update packages of the mini program and the APP are consistent, thereby ensuring that the functions of the updated mini program and the APP remain synchronized, improving the customer experience, which is a manifestation of the important inventive concept of the present invention.

[0040] In one embodiment, the operation of finding the difference between the first parsed data information and the second parsed data information is: mapping the first parsed data to a first DOM tree, using a first data structure to store the first DOM tree; mapping the second parsed data to a second DOM tree, using a second data structure to store the second DOM tree; comparing whether the composition structures of the first data structure and the second data structure are consistent, if yes, comparing the composition objects of the first data structure and the second data structure to determine the difference; if no, taking the parts with different composition structures as the difference. The first data structure and the second data structure are graph data structures.

[0041] In the present invention, in order to solve the matching difficulties caused by the different development languages ​​of the mini-program and the APP, the present invention creatively converts the parsed data of the mini-program and the APP into corresponding DOM trees, and stores the DOM trees in a graph data structure, that is, converts the DOM tree into a graph structure, so that the difference points can be quickly located, that is, the present invention compares whether the composition structures of the first data structure and the second data structure are consistent. If so, the composition objects of the first data structure and the second data structure are compared to determine the difference points; if not, the parts with different composition structures are used as difference points, so that the present invention forms a two-dimensional matching method of composition structure->composition object, thereby improving the efficiency of determining the difference points, which is another important invention point of the present invention.

[0042] In one embodiment, the operation of determining the functional consistency of the first update package and the second update package based on the difference point is: decompiling the first update package and the second update package into corresponding first assembly language codes and second assembly language codes, respectively; determining the difference code in the first assembly language code and the second assembly language code based on the difference point, and encapsulating the difference code in the first assembly language code and the second assembly language code into a first independent function and a second independent function, respectively; testing the first and second independent functions using multiple test variables, if the output results of the first and second independent functions are consistent, then it is considered that the functions of the first update package and the second update package are consistent, otherwise, they are not consistent.

[0043] In the present invention, in order to accurately determine the consistency of the functions of the mini program and the APP update package, the respective upgrade packages are decompiled into the same assembly language code, and then the difference code in the first assembly language code and the second assembly language code is determined based on the difference point, and the difference code in the first assembly language code and the second assembly language code is respectively encapsulated into a first independent function and a second independent function; the first and second independent functions are tested using multiple test variables, and if the output results of the first and second independent functions are consistent, it is considered that the functions of the first update package and the second update package are consistent. Since the difference point is determined by the two-dimensional matching method of composition structure->composition object, the speed of determining the difference code in the two assembly language codes is improved. In the present invention, the difference parts in the two assembly language codes are creatively encapsulated into corresponding independent functions, and the same test variables are used for testing to determine whether the test results are consistent. If they are consistent, it is considered that the mini program and the APP update package have the same functions, so that the updated mini program and APP functions can also be guaranteed to be consistent, which is another important invention of the present invention.

[0044] In one embodiment, the operation of encapsulating the difference code in the first assembly language code and the second assembly language code into the first independent function and the second independent function respectively is: respectively counting the number of variables and the number of code lines in the first assembly language code and the second assembly language code, respectively setting the first memory space and the second memory space in the memory based on the number of variables and the number of code lines in the first assembly language code and the second assembly language code, respectively loading the first assembly language code and the second assembly language code into the first memory space and the second memory space respectively, encapsulating the difference code in the first code into the first independent function in the first memory space, and encapsulating the difference code in the second code into the second independent function in the second memory space, wherein the physical addresses of the first memory space and the second memory space do not overlap.

[0045] In the present invention, in order to ensure the accuracy of independent function testing, a first memory space and a second memory space are set in the memory based on the statistical number of variables and the number of code lines in the first assembly language code and the second assembly language code, the first assembly language code and the second assembly language code are loaded in the first memory space and the second memory space respectively, the difference code in the first code is encapsulated as a first independent function in the first memory space, and the difference code in the second code is encapsulated as a second independent function in the second memory space. That is, in the present invention, two independent functions are constructed in independent memory spaces, thereby preventing the two decompiled assembly language codes from easily causing variable misreferences in the same memory space, thereby ensuring that the judgment result of the consistency of functions of the mini program and the APP update package is reliable, which is another important inventive point of the present invention.

[0046] In one embodiment, the operation of using multiple test variables to test the first and second independent functions is: using multiple test variables in the first memory space to test the first independent function, and saving the test results in a first test vector, using the same multiple test variables in the second memory space to test the second independent function, and saving the test results in a second test vector, and judging whether the output results are consistent based on the first test vector and the second test vector.

[0047] In the present invention, two independent functions are tested using the same test variables in independent memory spaces, and the test results are stored in corresponding test vectors. The test vectors can be compared using the cosine comparison method. Since the tests are performed in independent memory spaces, the reliability of the test results is ensured, which is one of the important inventive concepts of the present invention.

[0048] In one embodiment, the operation of setting the first memory space and the second memory space in the memory based on the number of variables and the number of code lines in the first assembly language code and the second assembly language code is:

[0049]

[0050] Among them, Mspace1 and Mspace2 respectively represent the sizes of the first and second memory spaces, varnum1 and varnum2 respectively represent the number of variables in the first and second assembly language codes, linenum1 and linenum2 respectively represent the number of code lines in the first and second assembly language codes, and packet1 and packet2 respectively represent the sizes of the first and second update packages.

[0051] Furthermore, the present invention designs a specific formula for presetting the corresponding memory space based on the running characteristics and code characteristics of the mini-program and APP. Since the mini-program is a hosted program, although its code is relatively small, the memory space it occupies during operation is larger than that of the APP. Therefore, when opening up the corresponding memory space, the mini-program adopts As the parameters are consistent, and for APP, use As one of the parameters, it ensures that no memory leaks or memory overflow errors occur during the corresponding independent function test process, thereby ensuring the reliability of the test results, which is another important inventive concept of the present invention.

[0052] Figure 2 A synchronous iteration device for energy internet marketing service system data of the present invention is shown, wherein the energy internet marketing service system includes an energy sales applet and an APP, and the device includes:

[0053] The acquisition unit 201 acquires update packages of the energy sales applet and the APP respectively, wherein the update package of the applet is a first update package, and the update package of the APP is a second update package;

[0054] A parsing unit 202 parses the first update package and the second update package to obtain first parsed data information and second parsed data information respectively;

[0055] The synchronous iteration unit 203 matches the first parsed data information and the second parsed data information, searches for differences between the first parsed data information and the second parsed data information, and determines the functional consistency of the first update package and the second update package based on the differences. If so, the energy sales applet and the APP are synchronously iterated and updated respectively using the first update package and the second update package based on the set trigger time point.

[0056] The applet in the present invention refers to a program that runs on other platforms and cannot run independently, such as the applet running in WeChat and Alipay. APP refers to a program that can be installed on a computer, mobile phone, tablet computer and other hardware devices and can run independently. The energy sales in the present invention refer to the sale of electricity, but of course it can also refer to the sale of other types of energy such as oil and natural gas.

[0057] In the present invention, in order to solve the defect of inconsistent functions between the mini program and the APP after update, the first update package and the second update package of the mini program and the APP are parsed respectively to obtain the corresponding first parsed data information and the second parsed data information; then the first parsed data information and the second parsed data information are matched, the difference between the first parsed data information and the second parsed data information are found, and the functional consistency of the first update package and the second update package is judged based on the difference. If yes, the energy sales mini program and the APP are synchronously iteratively updated respectively using the first update package and the second update package based on the set trigger time point. That is, in the present invention, the data after parsing the update packages of the mini program and the APP are matched to determine the difference, and based on the difference, it is determined whether the functions of the update packages of the mini program and the APP are consistent, thereby ensuring that the functions of the updated mini program and the APP remain synchronized, improving the customer experience, which is a manifestation of the important inventive concept of the present invention.

[0058] In one embodiment, the operation of finding the difference between the first parsed data information and the second parsed data information is: mapping the first parsed data to a first DOM tree, using a first data structure to store the first DOM tree; mapping the second parsed data to a second DOM tree, using a second data structure to store the second DOM tree; comparing whether the composition structures of the first data structure and the second data structure are consistent, if yes, comparing the composition objects of the first data structure and the second data structure to determine the difference; if no, taking the parts with different composition structures as the difference. The first data structure and the second data structure are graph data structures.

[0059] In the present invention, in order to solve the matching difficulties caused by the different development languages ​​of the mini-program and the APP, the present invention creatively converts the parsed data of the mini-program and the APP into corresponding DOM trees, and stores the DOM trees in a graph data structure, that is, converts the DOM tree into a graph structure, so that the difference points can be quickly located, that is, the present invention compares whether the composition structures of the first data structure and the second data structure are consistent. If so, the composition objects of the first data structure and the second data structure are compared to determine the difference points; if not, the parts with different composition structures are used as difference points, so that the present invention forms a two-dimensional matching method of composition structure->composition object, thereby improving the efficiency of determining the difference points, which is another important invention point of the present invention.

[0060] In one embodiment, the operation of determining the functional consistency of the first update package and the second update package based on the difference point is: decompiling the first update package and the second update package into corresponding first assembly language codes and second assembly language codes, respectively; determining the difference code in the first assembly language code and the second assembly language code based on the difference point, and encapsulating the difference code in the first assembly language code and the second assembly language code into a first independent function and a second independent function, respectively; testing the first and second independent functions using multiple test variables, if the output results of the first and second independent functions are consistent, then it is considered that the functions of the first update package and the second update package are consistent, otherwise, they are not consistent.

[0061] In the present invention, in order to accurately determine the consistency of the functions of the mini program and the APP update package, the respective upgrade packages are decompiled into the same assembly language code, and then the difference code in the first assembly language code and the second assembly language code is determined based on the difference point, and the difference code in the first assembly language code and the second assembly language code is respectively encapsulated into a first independent function and a second independent function; the first and second independent functions are tested using multiple test variables, and if the output results of the first and second independent functions are consistent, it is considered that the functions of the first update package and the second update package are consistent. Since the difference point is determined by the two-dimensional matching method of composition structure->composition object, the speed of determining the difference code in the two assembly language codes is improved. In the present invention, the difference parts in the two assembly language codes are creatively encapsulated into corresponding independent functions, and the same test variables are used for testing to determine whether the test results are consistent. If they are consistent, it is considered that the mini program and the APP update package have the same functions, so that the updated mini program and APP functions can also be guaranteed to be consistent, which is another important invention of the present invention.

[0062] In one embodiment, the operation of encapsulating the difference code in the first assembly language code and the second assembly language code into the first independent function and the second independent function respectively is: respectively counting the number of variables and the number of code lines in the first assembly language code and the second assembly language code, respectively setting the first memory space and the second memory space in the memory based on the number of variables and the number of code lines in the first assembly language code and the second assembly language code, respectively loading the first assembly language code and the second assembly language code into the first memory space and the second memory space respectively, encapsulating the difference code in the first code into the first independent function in the first memory space, and encapsulating the difference code in the second code into the second independent function in the second memory space, wherein the physical addresses of the first memory space and the second memory space do not overlap.

[0063] In the present invention, in order to ensure the accuracy of independent function testing, a first memory space and a second memory space are set in the memory based on the statistical number of variables and the number of code lines in the first assembly language code and the second assembly language code, the first assembly language code and the second assembly language code are loaded in the first memory space and the second memory space respectively, the difference code in the first code is encapsulated as a first independent function in the first memory space, and the difference code in the second code is encapsulated as a second independent function in the second memory space. That is, in the present invention, two independent functions are constructed in independent memory spaces, thereby preventing the two decompiled assembly language codes from easily causing variable misreferences in the same memory space, thereby ensuring that the judgment result of the consistency of functions of the mini program and the APP update package is reliable, which is another important inventive point of the present invention.

[0064] In one embodiment, the operation of using multiple test variables to test the first and second independent functions is: using multiple test variables in the first memory space to test the first independent function, and saving the test results in a first test vector, using the same multiple test variables in the second memory space to test the second independent function, and saving the test results in a second test vector, and judging whether the output results are consistent based on the first test vector and the second test vector.

[0065] In the present invention, two independent functions are tested using the same test variables in independent memory spaces, and the test results are stored in corresponding test vectors. The test vectors can be compared using the cosine comparison method. Since the tests are performed in independent memory spaces, the reliability of the test results is ensured, which is one of the important inventive concepts of the present invention.

[0066] In one embodiment, the operation of setting the first memory space and the second memory space in the memory based on the number of variables and the number of code lines in the first assembly language code and the second assembly language code is:

[0067]

[0068] Among them, Mspace1 and Mspace2 respectively represent the sizes of the first and second memory spaces, varnum1 and varnum2 respectively represent the number of variables in the first and second assembly language codes, linenum1 and linenum2 respectively represent the number of code lines in the first and second assembly language codes, and packet1 and packet2 respectively represent the sizes of the first and second update packages.

[0069] Furthermore, the present invention designs a specific formula for presetting the corresponding memory space based on the running characteristics and code characteristics of the mini-program and APP. Since the mini-program is a hosted program, although its code is relatively small, the memory space it occupies during operation is larger than that of the APP. Therefore, when opening up the corresponding memory space, the mini-program adopts As the parameters are consistent, and for APP, use As one of the parameters, it ensures that no memory leaks or memory overflow errors occur during the corresponding independent function test process, thereby ensuring the reliability of the test results, which is another important inventive concept of the present invention.

[0070] The corresponding technology of the present invention has been implemented in the headquarters of State Grid Jibei Company and five municipal companies. Judging from the implementation effect, it can solve the technical problem that there may be inconsistencies in the online functions of mini-programs and APPs, and improve the user experience.

[0071] In one embodiment of the present invention, a computer storage medium is provided, on which a computer program is stored. When the computer program on the computer storage medium is executed by a processor, the above method is implemented. The computer storage medium can be a hard disk, DVD, CD, flash memory or other memory.

[0072] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0073] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the devices described in the various embodiments of the present application or certain parts of the embodiments.

[0074] Finally, it should be noted that the above embodiments are only intended to illustrate rather than limit the technical solutions of the present invention. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the present invention can still be modified or replaced by equivalents. Any modification or partial replacement that does not depart from the spirit and scope of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A synchronous iteration method for energy internet marketing service system data, characterized in that: The energy internet marketing service system includes an energy sales applet and an APP, and the method includes: An acquisition step of acquiring update packages of the energy sales applet and the APP respectively, wherein the update package of the applet is a first update package, and the update package of the APP is a second update package; A parsing step of parsing the first update package and the second update package to obtain first parsed data information and second parsed data information respectively; a synchronous iteration step, matching the first parsed data information and the second parsed data information, finding the difference between the first parsed data information and the second parsed data information, and judging the functional consistency of the first update package and the second update package based on the difference, and if yes, using the first update package and the second update package to perform synchronous iterative updates on the energy sales applet and the APP respectively based on the set trigger time point; The operation of judging the functional consistency of the first update package and the second update package based on the difference point is: decompiling the first update package and the second update package into corresponding first assembly language codes and second assembly language codes respectively; determining the difference code in the first assembly language code and the second assembly language code based on the difference point, and encapsulating the difference code in the first assembly language code and the second assembly language code into a first independent function and a second independent function respectively; testing the first and second independent functions using multiple test variables, if the output results of the first and second independent functions are consistent, it is considered that the functions of the first update package and the second update package are consistent, otherwise, they are not consistent; Among them, the operation of encapsulating the difference code in the first assembly language code and the second assembly language code into the first independent function and the second independent function respectively is: respectively counting the number of variables and the number of code lines in the first assembly language code and the second assembly language code, setting the first memory space and the second memory space in the memory based on the number of variables and the number of code lines in the first assembly language code and the second assembly language code respectively, loading the first assembly language code and the second assembly language code into the first memory space and the second memory space respectively, encapsulating the difference code in the first code into the first independent function in the first memory space, and encapsulating the difference code in the second code into the second independent function in the second memory space, wherein the physical addresses of the first memory space and the second memory space do not overlap.

2. The method according to claim 1, characterized in that The operation of finding the difference between the first parsed data information and the second parsed data information is: mapping the first parsed data into a first DOM tree, and using a first data structure to store the first DOM tree; Mapping the second parsed data into a second DOM tree, and using a second data structure to store the second DOM tree; Comparing whether the component structures of the first data structure and the second data structure are consistent, and if so, comparing the component objects of the first data structure and the second data structure to determine the difference; If not, the parts with different composition structures are taken as the difference points.

3. The method according to claim 2, characterized in that The first data structure and the second data structure are graph data structures.

4. A synchronous iteration device for energy internet marketing service system data, characterized in that: The energy internet marketing service system includes an energy sales applet and an APP, and the device includes: An acquisition unit, respectively acquiring update packages of the energy sales applet and the APP, wherein the update package of the applet is a first update package, and the update package of the APP is a second update package; A parsing unit, parsing the first update package and the second update package to obtain first parsed data information and second parsed data information respectively; a synchronous iteration unit, matching the first parsed data information and the second parsed data information, finding the difference between the first parsed data information and the second parsed data information, and judging the functional consistency of the first update package and the second update package based on the difference, and if yes, using the first update package and the second update package to perform synchronous iterative updates on the energy sales applet and the APP respectively based on the set trigger time point; The operation of judging the functional consistency of the first update package and the second update package based on the difference point is: decompiling the first update package and the second update package into corresponding first assembly language codes and second assembly language codes respectively; determining the difference code in the first assembly language code and the second assembly language code based on the difference point, and encapsulating the difference code in the first assembly language code and the second assembly language code into a first independent function and a second independent function respectively; testing the first and second independent functions using multiple test variables, if the output results of the first and second independent functions are consistent, it is considered that the functions of the first update package and the second update package are consistent, otherwise, they are not consistent; Among them, the operation of encapsulating the difference code in the first assembly language code and the second assembly language code into the first independent function and the second independent function respectively is: respectively counting the number of variables and the number of code lines in the first assembly language code and the second assembly language code, setting the first memory space and the second memory space in the memory based on the number of variables and the number of code lines in the first assembly language code and the second assembly language code respectively, loading the first assembly language code and the second assembly language code into the first memory space and the second memory space respectively, encapsulating the difference code in the first code into the first independent function in the first memory space, and encapsulating the difference code in the second code into the second independent function in the second memory space, wherein the physical addresses of the first memory space and the second memory space do not overlap.

5. The device according to claim 4, characterized in that The operation of finding the difference between the first parsed data information and the second parsed data information is: mapping the first parsed data into a first DOM tree, and using a first data structure to store the first DOM tree; Mapping the second parsed data into a second DOM tree, and using a second data structure to store the second DOM tree; Comparing whether the component structures of the first data structure and the second data structure are consistent, and if so, comparing the component objects of the first data structure and the second data structure to determine the difference; If not, the parts with different composition structures are taken as the difference points.

6. The device according to claim 5, characterized in that The first data structure and the second data structure are graph data structures.

7. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program on the computer storage medium is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Cross-language code similarity detection system and method based on graph attention network

    CN118227139A